Selaa lähdekoodia

Merge branch 'main' of https://gitlab.com/tea28/client

hejie 3 vuotta sitten
vanhempi
sitoutus
f3fac65fcd
3 muutettua tiedostoa jossa 26 lisäystä ja 34 poistoa
  1. 2 0
      src/pages/index/index.vue
  2. 1 1
      src/pages/product/p_details.vue
  3. 23 33
      src/pages/sign/index.vue

+ 2 - 0
src/pages/index/index.vue

@@ -53,6 +53,8 @@
     </div>
 </template>
 <script>
+let app=getApp();
+var appEv = app.$vm.$options;
 import goodslist from "@/components/goodsList"; //商品列表
 import swiperBanner from "@/components/swiperBanner"; //轮播
 import { get, post } from "@/request/api.js";

+ 1 - 1
src/pages/product/p_details.vue

@@ -91,9 +91,9 @@
 <script>
 let page = 1;
 let app=getApp();
-// let reqApi = new ReqApi();
 var appEv = app.$vm.$options;
 import { get, post, u_post } from "@/request/api.js";
+// let reqApi = new ReqApi();
 // import { ReqApi } from "@/utils/reqTools.js";
 import uniPopup from '@/components/uni-popup/uni-popup.vue'
 import jyfParser from '@/components/jyf-parser/jyf-parser.vue'

+ 23 - 33
src/pages/sign/index.vue

@@ -129,7 +129,7 @@ let app = getApp();
 var appEv = app.$vm.$options;
 import uniPopup from '@/components/uni-popup/uni-popup.vue'
 import authorizeModule from '@/components/authorize-module/index'
-import { get, post } from "@/request/api.js";
+import { get, post, u_post } from "@/request/api.js";
 export default {
     components: { uniPopup, authorizeModule },
     data() {
@@ -177,9 +177,7 @@ export default {
     methods: {
         loadData: function() {
             let that = this;
-            post("ShuZiTeaIntegral/integral/integralInfoNew", {
-                userId: 2064
-            }).then(res => {
+            u_post("ShuZiTeaIntegral/integral/integralInfoNew").then(res => {
                 if (res.status == 200) {
                     that.integerInfo = res.integerInfo
                     that.userInof = res.userInof
@@ -220,9 +218,7 @@ export default {
         // 签到
         setSignIn: function() {
             let that = this;
-            post("ShuZiTeaIntegral/integral/reportNew", {
-                userId: 2064
-            }).then(res => {
+            u_post("ShuZiTeaIntegral/integral/reportNew").then(res => {
                 if (res.status == 200) {
                     console.log(res)
                     appEv.errTips(res.msg)
@@ -259,9 +255,7 @@ export default {
                     let obj = res.goods
                     that.goods = []
                     if (obj.length > 0) {
-                        for (var i in obj) {
-                            that.goods.push(obj[i])
-                        }
+                        that.goods = [...that.goods,...obj]
                     } else {
                         if (page == 1) {
                             that.haveGoods = true
@@ -285,7 +279,7 @@ export default {
         // 获取兑换方式
         integralMethodChange: function() {
             let that = this;
-            post("ShuZiTeaIntegral/integral/integralMethodChange").then(res => {
+            u_post("ShuZiTeaIntegral/integral/integralMethodChange").then(res => {
                 if (res.status == 200) {
                     that.way_list = res.data
                 }
@@ -331,28 +325,24 @@ export default {
             } else {
                 data.jeType = 3
             }
-
-            const info = reqApi.integralClickExchange(data)
-            if (info) {
-                info.then(res => {
-                    if (res.status == 200) {
-                        appEv.errTips(res.msg)
-                        let goodsId = that.goodsId;
-                        let count = 1;
-                        let goodsType = 5;
-                        let ojsType = 1;
-                        let payType = !isShow ? 3 : isShow && pay_way == 0 ? 4 : isShow && pay_way == 1 ? 5 : isShow && that.way_list[that.currrent].Integral == 0 ? 6 : ''
-                        setTimeout(() => {
-                            uni.navigateTo({
-                                url: '/pages/to-pay-list/index?goodsId=' + goodsId + "&count=" + count + '&goodsType=' + goodsType + '&ojsType=' + ojsType + '&payType=' + payType
-                            })
-                        }, 800)
-                    } else {
-                        appEv.errTips(res.msg)
-                        that.isShow = true;
-                    }
-                })
-            }
+            u_post("ShuZiTeaIntegral/integral/integralMethodChange",data).then(res => {
+                if (res.status == 200) {
+                    appEv.errTips(res.msg)
+                    let goodsId = that.goodsId;
+                    let count = 1;
+                    let goodsType = 5;
+                    let ojsType = 1;
+                    let payType = !isShow ? 3 : isShow && pay_way == 0 ? 4 : isShow && pay_way == 1 ? 5 : isShow && that.way_list[that.currrent].Integral == 0 ? 6 : ''
+                    setTimeout(() => {
+                        uni.navigateTo({
+                            url: '/pages/to-pay-list/index?goodsId=' + goodsId + "&count=" + count + '&goodsType=' + goodsType + '&ojsType=' + ojsType + '&payType=' + payType
+                        })
+                    }, 800)
+                } else {
+                    appEv.errTips(res.msg)
+                    that.isShow = true;
+                }
+            })
         },
         // 更改协议选中情况
         checkboxChange: function(e) {