From 7333043a4f1a42f755f7685d9a4f7d000571c30c Mon Sep 17 00:00:00 2001 From: Gao xiaosong <704041637@qq.com> Date: Sun, 18 Apr 2021 15:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/OrderGoods.vue | 4 +- config/index.js | 5 +- main.js | 85 +- pages/home/index.vue | 828 +++++++++---------- pages/order/MyOrder/index.vue | 219 +++-- pages/orderAdmin/OrderCancellation/index.vue | 357 ++++---- pages/shop/GoodsCollection/index.vue | 95 ++- pages/shop/GoodsFoot/index.vue | 95 ++- pages/user/UserAccount/index.vue | 59 +- utils/index.js | 20 +- 10 files changed, 863 insertions(+), 904 deletions(-) diff --git a/components/OrderGoods.vue b/components/OrderGoods.vue index 50fac18..19b22f5 100644 --- a/components/OrderGoods.vue +++ b/components/OrderGoods.vue @@ -12,7 +12,8 @@ x {{ cart.cartNum }} {{ cart.productInfo.attrInfo.sku }} - ¥{{ cart.truePrice }} + {{ cart.costPrice }}积分 + ¥{{ cart.truePrice }} 评价 @@ -28,6 +29,7 @@ export default { type: Array, default: () => [], }, + isIntegral: Boolean, }, data: function() { return {} diff --git a/config/index.js b/config/index.js index 728afb9..1bc2e16 100644 --- a/config/index.js +++ b/config/index.js @@ -1,6 +1,7 @@ // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; -export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'; -// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api'; +export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' +// export const VUE_APP_API_URL = 'http://139.186.134.205:9006/api' +// export const VUE_APP_API_URL = 'http://192.168.31.223:8008/api' // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://tapi.xinxintuan.co/api' // export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; diff --git a/main.js b/main.js index f4fa072..915d91d 100644 --- a/main.js +++ b/main.js @@ -14,7 +14,7 @@ Vue.component('cu-custom', cuCustom) Vue.config.productionTip = false Vue.config.devtools = process.env.NODE_ENV !== 'production' -Vue.prototype.$validator = function (rule) { +Vue.prototype.$validator = function(rule) { return new schema(rule) } @@ -27,23 +27,6 @@ const app = new Vue({ store, }) -Vue.mixin({ - onLoad() { - const { $mp } = this.$root - this._route = parseRoute($mp) - }, - onShow() { - _router.app = this - _router.currentRoute = this._route - }, - // 这里为了解决 .vue文件中 template 无法获取 VUE.prototype 绑定的变量 - computed: { - $VUE_APP_RESOURCES_URL() { - return VUE_APP_RESOURCES_URL; - } - } -}) - Object.defineProperty(Vue.prototype, '$yrouter', { get() { return _router @@ -59,17 +42,16 @@ Object.defineProperty(Vue.prototype, '$yroute', { Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL Vue.component('cu-custom', cuCustom) +let deviceType = '' // #ifdef APP-PLUS // App平台编译的代码 -Vue.prototype.$deviceType = 'app' -store.commit('updateDevicetype', 'app') +deviceType = 'app' Vue.prototype.$platform = uni.getSystemInfoSync().platform // #endif // #ifdef MP-WEIXIN // 微信小程序编译的代码 -Vue.prototype.$deviceType = 'routine' -store.commit('updateDevicetype', 'routine') +deviceType = 'routine' // #endif // !!! ps 不建议在 template 中使用 $deviceType 去判断当前环境,很有可能出现 $deviceType 为 undefined 导致判断出错的问题,可以在 script 模块中正常使用 @@ -99,29 +81,42 @@ if (urlSpread) { // #endif -async function init() { - // #ifdef H5 - // H5编译的代码 - // 判断是否是微信浏览器 - if (isWeixin()) { - Vue.prototype.$deviceType = 'weixin' - store.commit('updateDevicetype', 'weixin') - let wechatInit = await wechat() - console.log(wechatInit) - if (wechatInit) { - await oAuth() - app.$mount() - } - } else { - Vue.prototype.$deviceType = 'weixinh5' - store.commit('updateDevicetype', 'weixinh5') - app.$mount() +// #ifdef H5 +// H5编译的代码 +// 判断是否是微信浏览器 +if (isWeixin()) { + deviceType = 'weixin' + let wechatInit = await wechat() + if (wechatInit) { + await oAuth() } - // #endif - - // #ifndef H5 - app.$mount() - // #endif +} else { + deviceType = 'weixinh5' } +// #endif + +Vue.prototype.$deviceType = deviceType + +Vue.mixin({ + onLoad() { + const { $mp } = this.$root + this._route = parseRoute($mp) + }, + onShow() { + _router.app = this + _router.currentRoute = this._route + }, + // 这里为了解决 .vue文件中 template 无法获取 VUE.prototype 绑定的变量 + computed: { + $VUE_APP_RESOURCES_URL() { + return VUE_APP_RESOURCES_URL + }, + $deviceType() { + return deviceType + }, + }, +}) + +store.commit('updateDevicetype', deviceType) -init() +app.$mount() diff --git a/pages/home/index.vue b/pages/home/index.vue index 510ff15..c4647da 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -1,448 +1,438 @@ diff --git a/pages/order/MyOrder/index.vue b/pages/order/MyOrder/index.vue index b18a4da..524ac2d 100644 --- a/pages/order/MyOrder/index.vue +++ b/pages/order/MyOrder/index.vue @@ -4,7 +4,7 @@ 订单信息 - 累计订单:{{ orderData.orderCount || 0 }} 总消费:¥{{orderData.sumPrice || 0 }} + 累计订单:{{ orderData.orderCount || 0 }} 总消费:¥{{ orderData.sumPrice || 0 }} @@ -31,13 +31,10 @@ - + - 拼团 + 拼团 秒杀 砍价 门店 @@ -46,24 +43,15 @@ {{ getStatus(order) }} - + - + {{ cart.productInfo.storeName }} - - ¥{{ - cart.productInfo.attrInfo - ? cart.productInfo.attrInfo.price - : cart.productInfo.price - }} - - - {{order.payIntegral}}积分 - + ¥{{ cart.productInfo.attrInfo ? cart.productInfo.attrInfo.price : cart.productInfo.price }} + {{ order.payIntegral }}积分 x{{ cart.cartNum }} @@ -107,8 +89,8 @@ 共{{ order.cartInfo.length || 0 }}件商品,总金额 - ¥{{ order.payPrice }} - {{order.payIntegral}}积分 + ¥{{ order.payPrice }} + {{ order.payIntegral }}积分 diff --git a/pages/shop/GoodsCollection/index.vue b/pages/shop/GoodsCollection/index.vue index 298a06c..c9f5f44 100644 --- a/pages/shop/GoodsCollection/index.vue +++ b/pages/shop/GoodsCollection/index.vue @@ -1,30 +1,22 @@ diff --git a/pages/shop/GoodsFoot/index.vue b/pages/shop/GoodsFoot/index.vue index 642e85a..a405eef 100644 --- a/pages/shop/GoodsFoot/index.vue +++ b/pages/shop/GoodsFoot/index.vue @@ -1,30 +1,22 @@ diff --git a/pages/user/UserAccount/index.vue b/pages/user/UserAccount/index.vue index cc7e19e..a7a96de 100644 --- a/pages/user/UserAccount/index.vue +++ b/pages/user/UserAccount/index.vue @@ -8,7 +8,7 @@ 总资产(元) {{ now_money }} - 充值 + 充值 @@ -31,7 +31,7 @@ 消费记录 - + @@ -44,59 +44,58 @@ diff --git a/utils/index.js b/utils/index.js index 911ccae..83f39dc 100644 --- a/utils/index.js +++ b/utils/index.js @@ -499,6 +499,22 @@ export const handleLoginStatus = (location, complete, fail, success) => { path: '/pages/home/index', name: '首页', }, + { + path: '/pages/shop/HotNewGoods/index', + name: '热门榜单', + }, + { + path: '/pages/activity/GoodsGroup/index', + name: '超值拼团', + }, + { + path: '/pages/shop/Live/LiveList/index', + name: '热门直播', + }, + { + path: '/pages/shop/GoodsClass/index', + name: '商品分类', + }, { path: '/pages/user/Login/index', name: '登录页面', @@ -520,7 +536,7 @@ export const handleLoginStatus = (location, complete, fail, success) => { } else { path = location.path } - + console.log(path) // 判断用户是否有token if (!handleAuth()) { page.map(item => { @@ -531,7 +547,7 @@ export const handleLoginStatus = (location, complete, fail, success) => { } else { isAuth = true } - + console.log(isAuth) return new Promise((resolve, reject) => { if (isAuth) { // 有token