Browse Source

颜选美学bug修改

yuwenjun1997 2 years ago
parent
commit
b0e43c2c40

+ 15 - 0
App.vue

@@ -1,6 +1,21 @@
 <script>
 export default {
     onLaunch: function() {
+        const updateManager = uni.getUpdateManager()
+        updateManager.onCheckForUpdate(function(res) {
+            console.log(res.hasUpdate)
+        })
+        updateManager.onUpdateReady(function(res) {
+            uni.showModal({
+                title: '更新提示',
+                content: '新版本已经准备好,是否重启小程序?',
+                success(res) {
+                    if (res.confirm) {
+                        updateManager.applyUpdate()
+                    }
+                }
+            })
+        })
         this.$store.dispatch('app/initDevice')
     }
 }

+ 5 - 5
pages.json

@@ -3,13 +3,13 @@
     "pages": [{
         "path": "pages/index/index",
         "style": {
-            "navigationBarTitleText": "呵呵商城",
+            "navigationBarTitleText": "颜选美学",
             "enablePullDownRefresh": false
         }
     }, {
         "path": "pages/tabBar/home/home",
         "style": {
-            "navigationBarTitleText": "呵呵商城",
+            "navigationBarTitleText": "颜选美学",
             "enablePullDownRefresh": true,
             "backgroundColor": "#F952B7",
             "navigationBarBackgroundColor": "#F952B7",
@@ -237,13 +237,13 @@
             "pages": [{
                 "path": "join-us",
                 "style": {
-                    "navigationBarTitleText": "欢迎加入呵呵商城",
+                    "navigationBarTitleText": "欢迎加入颜选美学",
                     "enablePullDownRefresh": false
                 }
             }, {
                 "path": "web-view",
                 "style": {
-                    "navigationBarTitleText": "呵呵商城",
+                    "navigationBarTitleText": "颜选美学",
                     "enablePullDownRefresh": false
                 }
             }]
@@ -253,7 +253,7 @@
     // 全局主题配置
     "globalStyle": {
         "navigationBarTextStyle": "black",
-        "navigationBarTitleText": "呵呵商城",
+        "navigationBarTitleText": "颜选美学",
         "navigationBarBackgroundColor": "#FFFFFF",
         "backgroundColor": "#FFFFFF"
     },

+ 1 - 1
pages/authorize/login-custom.vue

@@ -80,7 +80,7 @@ export default {
     computed: {
         ...mapGetters(['openId']),
         tipMessage() {
-            return this.tipMsg || '未注册的手机号验证后自动创建呵呵商城账户'
+            return this.tipMsg || '未注册的手机号验证后自动创建颜选美学账户'
         },
         disabled() {
             return !this.valide.mobile || !this.valide.verificationCode

+ 10 - 9
pages/index/index.vue

@@ -21,7 +21,7 @@ export default {
         this.initUserInfo()
     },
     methods: {
-        ...mapMutations('user', ['SET_USER_INFO']),
+        // ...mapMutations('user', ['SET_USER_INFO']),
         ...mapActions('user', ['wxAutoLogin', 'getAccessToken']),
         ...mapActions('coupon', ['initCouponCount']),
         ...mapActions('cart', ['fetchCartKindCount']),
@@ -36,14 +36,15 @@ export default {
         // 初始化用户信息
         async initUserInfo() {
             try {
-                const user = this.$getStorage('USER_INFO')
-                if (user) {
-                    // 用户已登录
-                    this.SET_USER_INFO(user)
-                } else {
-                    // 微信登录
-                    await this.wxAutoLogin()
-                }
+                // const user = this.$getStorage('USER_INFO')
+                // if (user) {
+                //     // 用户已登录
+                //     this.SET_USER_INFO(user)
+                // } else {
+                //     // 微信登录
+                //     await this.wxAutoLogin()
+                // }
+                await this.wxAutoLogin()
             } catch (e) {
                 console.log('初始化用户信息时出现了错误')
                 console.log(e)

+ 4 - 4
pages/tabBar/home/home.vue

@@ -24,7 +24,7 @@
         <view class="join-us">
             <image :src="staticUrl + 'icon-join-us.png'" class="join-icon"></image>
             <view class="join-content">
-                <view class="join-label-title">呵呵商城福利群</view>
+                <view class="join-label-title">颜选美学福利群</view>
                 <view class="join-label-text">进群第一时间得知优惠福利!</view>
             </view>
             <view class="join-button" @click="handleJoinUs">加入我们</view>
@@ -113,8 +113,8 @@ export default {
         },
 
         // 优惠券点击(领取)
-        onCouponClick(coupon) {
-            coupon = { ...coupon }
+        onCouponClick(couponData) {
+            const coupon = { ...couponData }
             if (coupon.controlType === 'receive') {
                 const index = this.couponList.findIndex(item => item.couponId === coupon.couponId)
                 this.couponList.splice(index, 1)
@@ -123,7 +123,7 @@ export default {
             }
         },
 
-        // 商品楼层轮播图点击事件
+        // 商品楼层banner点击事件
         onBannerClick(banner) {
             if (!banner.link) return
             this.$router.navigateTo(`others/web-view?websit=${banner.link}`)

+ 13 - 6
pages/views/coupon/components/coupon-desc-entry/coupon-desc-entry.vue

@@ -7,7 +7,8 @@
             :key="item.id"
             @click="$emit('click', item)"
         >
-            <view class="text" v-text="item.name"></view> <view class="control">点击查看</view>
+            <view class="text" v-text="item.name"></view>
+            <view class="control">点击查看</view>
         </view>
     </view>
 </template>
@@ -15,9 +16,15 @@
 <script>
 export default {
     name: 'coupon-desc-entry',
-    data() {
-        return {
-            entryList: [
+    props: {
+        couponTipStr: {
+            type: String,
+            default: ''
+        }
+    },
+    computed: {
+        entryList() {
+            const result = [
                 {
                     id: 1,
                     name: '好友邀请券福利'
@@ -31,9 +38,9 @@ export default {
                     name: '分享券福利'
                 }
             ]
+            return result.filter(item => this.couponTipStr.indexOf(item.id.toString()) > -1)
         }
-    },
-    methods: {}
+    }
 }
 </script>
 

+ 3 - 3
pages/views/coupon/config/description.js

@@ -3,7 +3,7 @@ export default [{
     type: 'tip',
     title: '好友邀请券福利来袭啦',
     tip: '好友邀请券获取规则',
-    content: '用户登录呵呵商城后,可通过商城首页或商城右上角按钮以及商品详情分享至好友,当好友通过您分享的链接进行注册登录后,您就可以获得一张好友邀请券的领券资格。',
+    content: '用户登录颜选美学后,可通过商城首页或商城右上角按钮以及商品详情分享至好友,当好友通过您分享的链接进行注册登录后,您就可以获得一张好友邀请券的领券资格。',
     styleObj: {
         titleColor: '',
         tipColor: '',
@@ -14,11 +14,11 @@ export default [{
     type: 'tip',
     title: '好友消费券福利来袭啦',
     tip: '好友消费券获取规则',
-    content: '用户登录呵呵商城后,可通过商城首页或商城右上角按钮以及商品详情分享至好友,当好友通过您分享的链接进行注册登录后,每消费一笔订单后,您就可以获得一张好友消费券的领券资格。'
+    content: '用户登录颜选美学后,可通过商城首页或商城右上角按钮以及商品详情分享至好友,当好友通过您分享的链接进行注册登录后,每消费一笔订单后,您就可以获得一张好友消费券的领券资格。'
 }, {
     id: 3,
     type: 'tip',
     title: '分享券福利来袭',
     tip: '分享券获取规则',
-    content: '用户登录呵呵商城后,每消费一笔订单后在支付完成页面点击分享给微信好友或生成海报分享后,您就可以获得一张好友消费券的领券资格。'
+    content: '用户登录颜选美学后,每消费一笔订单后在支付完成页面点击分享给微信好友或生成海报分享后,您就可以获得一张消费分享券的领券资格。'
 }]

+ 17 - 4
pages/views/coupon/coupon-receive.vue

@@ -14,7 +14,7 @@
             </view>
         </view>
         <!-- 优惠券说明 -->
-        <coupon-desc-entry @click="toDescDetail" v-if="userId"></coupon-desc-entry>
+        <coupon-desc-entry @click="toDescDetail" v-if="userId" :couponTipStr="couponTipStr"></coupon-desc-entry>
         <!-- 加载更多 -->
         <cm-loadmore :hasMore="hasNextPage" :isLoading="isLoading" :visiable="visiable"></cm-loadmore>
         <!-- 占位 -->
@@ -37,7 +37,7 @@
 </template>
 
 <script>
-import { fetchCouponCenterInfo } from '@/services/api/coupon.js'
+import { fetchCouponCenterInfo, fetchCouponDisplay } from '@/services/api/coupon.js'
 import { debounce } from '@/common/utils.js'
 import { mapGetters } from 'vuex'
 export default {
@@ -52,7 +52,8 @@ export default {
             total: 0,
             hasNextPage: true,
             isLoading: false,
-            isRequest: true
+            isRequest: true,
+            couponTipStr: ''
         }
     },
     computed: {
@@ -66,6 +67,7 @@ export default {
     },
     onLoad() {
         this.initCouponList()
+        this.fetchCouponDisplay() // 获取可领取优惠券类型
     },
     methods: {
         // 优惠券操作事件
@@ -99,12 +101,23 @@ export default {
                 this.isLoading = false
             }
         }, 200),
+
+        // 获取可领取优惠券类型
+        async fetchCouponDisplay() {
+            try {
+                const res = await fetchCouponDisplay({ userId: this.userId })
+                this.couponTipStr = res.data
+            } catch (e) {
+                console.log('获取优惠券类型失败')
+            }
+        },
+
         // 查看描述详情
         toDescDetail(entry) {
             this.$router.navigateTo('coupon/coupon-description?entryType=' + entry.id)
         },
         // 我的优惠券
-        userCouponCenter(){
+        userCouponCenter() {
             this.$router.redirectTo('coupon/coupon-user')
         }
     }

+ 2 - 2
pages/views/goods/components/goods-price/goods-price.vue

@@ -3,7 +3,7 @@
         <view class="row">
             <view class="price">
                 <text class="amount">{{ productData.price | priceFormat }}</text>
-                <text class="delete" v-if="priceType !== 'normal'">{{ productData.normalPrice | priceFormat }}</text>
+                <text class="delete" v-if="priceType !== 'normal' && productData.normalPrice">{{ productData.normalPrice | priceFormat }}</text>
             </view>
             <view class="price-tags">
                 <template v-if="priceType !== 'normal'">
@@ -13,7 +13,7 @@
                 </template>
             </view>
             <!-- 券后价 -->
-            <view class="tag-qh" v-if="priceType === 'normal'">
+            <view class="tag-qh" v-if="hasCouponPrice && priceType === 'normal'">
                 券后价¥{{ productData.couponPrice | priceFormat }}
             </view>
         </view>

+ 2 - 7
pages/views/order/order-pay.vue

@@ -47,7 +47,7 @@
             </view>
         </template>
 
-        <view class="shop-info">
+        <!-- <view class="shop-info">
             <view class="shop-name">采美快递物流商</view>
             <view class="product-list">
                 <view class="product">
@@ -63,18 +63,13 @@
                     </view>
                 </view>
             </view>
-            <!-- <view class="total">
-				<text>优惠:¥20.00</text>
-				<text>已付:¥0</text>
-			</view> -->
             <view class="foot">
                 <view class="price">
                     <text>待付:</text>
                     <text class="active">¥0</text>
                 </view>
-                <!-- <view class="submit" @click="onPay">付款</view> -->
             </view>
-        </view>
+        </view> -->
 
         <!-- 操作弹窗 -->
         <tui-modal :show="modal" content="确认支付?" :maskClosable="false" @click="handleModalConfirm"></tui-modal>

+ 13 - 0
pages/views/order/pay-faild.vue

@@ -48,11 +48,24 @@ export default {
     },
     beforeDestroy() {
         uni.removeStorageSync('PAY_ORDER_INFO')
+        this.$off('orderPaySuccess')
     },
     onLoad() {
         this.orderInfo = uni.getStorageSync('PAY_ORDER_INFO')
+        this.orderPaySuccess()
     },
     methods: {
+        // 支付成功回调
+        orderPaySuccess() {
+            this.$on('orderPaySuccess', orderInfo => {
+                if (this.collageFlag === 1) {
+                    uni.redirectTo({ url: `share-buy/share-buy-detail?collageId=${this.collageId}` })
+                } else {
+                    uni.setStorageSync('PAY_ORDER_INFO', orderInfo)
+                    this.$router.redirectTo('order/pay-success')
+                }
+            })
+        },
         onPayAgain() {
             this.miniWxPayFor(this.orderInfo)
         },

+ 9 - 9
services/api/pay.js

@@ -9,18 +9,18 @@ import request from '@/services/http.request.js'
  *@param  orderId  主订单ID
  */
 export function wechatMiniWxPay(data) {
-	return request({
-		url: '/PayOrder/miniWxPay',
-		method: 'POST',
-		data,
+    return request({
+        url: '/order/pay/online',
+        method: 'POST',
+        data,
         loading: '支付中'
-	})
+    })
 }
 
 /* 小程序线上支付开关 */
 export function checkPayOnlineSwitch() {
-	return request({
-		url: '/PayOrder/onLineSwitch',
-		method: 'GET'
-	})
+    return request({
+        url: '/order/pay/online/switch',
+        method: 'GET'
+    })
 }

+ 2 - 2
services/config.env.js

@@ -1,8 +1,8 @@
 export let APP_API_URI = ''
 if (process.env.NODE_ENV === 'development') {
     // 开发环境
-    APP_API_URI = 'http://192.168.2.68:8011'	 //本地联调地址
-    // APP_API_URI = 'https://mall2c-b.caimei365.com'
+    // APP_API_URI = 'http://192.168.2.68:8011'	 //本地联调地址
+    APP_API_URI = 'https://mall2c-b.caimei365.com'
     // APP_API_URI = 'https://mall2c.caimei365.com'
 } else {
     // 生产环境