Explorar el Código

更换图片地址

xiaoxin hace 1 año
padre
commit
7413b9e95c
Se han modificado 3 ficheros con 21 adiciones y 34 borrados
  1. 13 6
      main.js
  2. 1 1
      pages/index/index.vue
  3. 7 27
      pages/index/shop/index.vue

+ 13 - 6
main.js

@@ -15,22 +15,29 @@ Vue.prototype.$SysCache = HttpCache;
 import uView from "uview-ui";
 Vue.use(uView);
 
+//全局图片请求头
+Vue.prototype.Tupian = (img) => {
+	return 'https://moxuanyunshang.oss-cn-beijing.aliyuncs.com' + img
+}
+
 // #ifndef VUE3
 import Vue from 'vue'
 Vue.config.productionTip = false
 App.mpType = 'app'
 const app = new Vue({
-    ...App
+	...App
 })
 app.$mount()
 // #endif
 
 // #ifdef VUE3
-import { createSSRApp } from 'vue'
+import {
+	createSSRApp
+} from 'vue'
 export function createApp() {
-  const app = createSSRApp(App)
-  return {
-    app
-  }
+	const app = createSSRApp(App)
+	return {
+		app
+	}
 }
 // #endif

+ 1 - 1
pages/index/index.vue

@@ -285,7 +285,7 @@
 						X
 					</view>
 					 <!-- @click="takemoney()" ../../static/images/index/hb_bg.png-->
-					<image src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240520171928.jpg" class="hb_img"></image>
+					<image :src="Tupian('/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240520171928.jpg')" class="hb_img"></image>
 					<!-- <image src="../../static/images/index/hb_btn.png" class="hb_btn" @click="takemoney()"></image> -->
 				</view>
 			</view>

+ 7 - 27
pages/index/shop/index.vue

@@ -286,54 +286,34 @@
 					<view class="padding-bottom" v-if="current == 3">
 						<view class="shop_xiang">
 							<view class="shopDizhi margin-lr">
-								<image
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/address.png"
-									class="radius"
-									style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"
-								></image>
+								<image :src="Tupian('/shopXiang/address.png')" class="radius" style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"></image>
 								<text style="margin-left: 5px">{{ shopDet.detailedAddress }}</text>
 								<image
 									@click="call(shopDet.phone)"
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/phone.png"
+									:src="Tupian('/shopXiang/phone.png')"
 									class="radius"
 									style="width: 44rpx; height: 44rpx; float: right; margin-top: 20rpx"
 								></image>
 							</view>
 							<view class="shopLine margin-lr"></view>
 							<view class="shopDizhi margin-lr">
-								<image
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/22.png"
-									class="radius"
-									style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"
-								></image>
+								<image :src="Tupian('/shopXiang/22.png')" class="radius" style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"></image>
 								<text style="margin-left: 5px">营业时间:{{ shopDet.businessHours }}-{{ shopDet.lockHours }}</text>
 							</view>
 							<view class="shopLine margin-lr"></view>
 							<view class="shopDizhi margin-lr">
-								<image
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/33.png"
-									class="radius"
-									style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"
-								></image>
+								<image :src="Tupian('/shopXiang/33.png')" class="radius" style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"></image>
 								<text style="margin-left: 5px">商家品类:{{ shopDet.shopTypeName }}</text>
 							</view>
 							<view class="shopLine margin-lr"></view>
 							<view class="shopDizhi margin-lr">
-								<image
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/44.png"
-									class="radius"
-									style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"
-								></image>
+								<image :src="Tupian('/shopXiang/44.png')" class="radius" style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"></image>
 								<text style="margin-left: 5px">配送范围:{{ shopDet.distributionDistance }}以内</text>
 							</view>
 						</view>
 						<view class="shop_zheng">
 							<view class="shopDizhi margin-lr">
-								<image
-									src="https://moxuanyunshang.oss-cn-beijing.aliyuncs.com/shopXiang/55.png"
-									class="radius"
-									style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"
-								></image>
+								<image :src="Tupian('/shopXiang/55.png')" class="radius" style="width: 44rpx; height: 44rpx; float: left; margin-top: 20rpx"></image>
 								<text style="margin-left: 5px">营业执照,食品经营许可和健康证</text>
 							</view>
 							<view class="image-container" v-if="shop_zhizhao.length > 0">
@@ -2182,4 +2162,4 @@ page {
 	width: 180rpx; /* 三张图片平分宽度 */
 	height: 135rpx;
 }
-</style>
+</style>