Browse Source

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

DaMowang 3 years ago
parent
commit
968595f4ee

+ 19 - 0
src/pages.json

@@ -42,6 +42,12 @@
 				"navigationBarTitleText": "批发专区"
 			}
 		},
+		{
+			"path": "pages/product/productTeaBaby",
+			"style": {
+				"navigationBarTitleText": "茶宝兑换"
+			}
+		},
 		{
 			"path": "pages/product/p_details",
 			"style": {
@@ -209,6 +215,19 @@
 			"style": {
 				"navigationBarTitleText": "茶友等级介绍"
 			}
+		},
+		{
+			"path": "pages/my-credites/index",
+			"style": {
+				"navigationBarTitleText": "茶宝兑换",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
+			"path" : "pages/integral-list/index",
+			"style" : {
+				"navigationBarTitleText": "积分专区"
+			}
 		}
 	],
 	"tabBar": {

+ 3 - 3
src/pages/index/index.vue

@@ -87,7 +87,7 @@ export default {
                  {name: "零售区", url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/menu/cart.png", type:1},
                  {name: "批发区", url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/menu/wholesale.png", type:2},
                  {name: "精品优选", url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/menu/preferred.png", type:3},
-                 {name: "今日值得买", url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/menu/integral.png", type:4}
+                 {name: "茶宝兑换", url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/menu/integral.png", type:5}
             ],
             spc_list: [
                 {url: "https://teaclub.oss-cn-chengdu.aliyuncs.com/ShuZiTea/ShuZiTeaHT/202210/f70cd8e0-e468-45eb-a9f7-2c42713cd607.jpg"},
@@ -173,8 +173,8 @@ export default {
             else if(item.type == 3){
                 this.goto('/pages/product/productRetail',{type:item.type})
             }
-            else if(item.type == 4){
-                this.goto('/pages/product/productRetail',{type:item.type})
+            else if(item.type == 5){
+                this.goto('/pages/product/productTeaBaby',{type:item.type})
             }
             else{
                 appEv.errTips('此功能暂未开放!')

+ 501 - 0
src/pages/integral-list/index.vue

@@ -0,0 +1,501 @@
+<template>
+  <view class="container">
+
+    <!-- 积分兑换 -->
+    <view class="integral">
+      <view class="integral_title flex_r flex_ac">
+        <view class="inte_icon"></view>
+        <view class="inte_text">积分兑换</view>
+      </view>
+      <view class="goods flex_r" v-for="(item, index) in list" :key="index">
+        <image class="goods_img" :src="item.goodsThumbnailUrl" mode=""></image>
+        <view class="goods_info flex_c flex_jc">
+          <view class="goods_name ellipsis">{{ item.goodsName }}</view>
+          <view class="msg">{{ item.integral }}消费积分</view>
+          <view
+            class="info_btn flex_r flex_ac flex_jc"
+            @tap="openConversion(item.goodsId)"
+            >立即兑换</view
+          >
+        </view>
+      </view>
+    </view>
+    <!-- 积分兑换-end -->
+
+    <!-- 兑换弹窗 -->
+    <uni-popup type="center" ref="conversion">
+      <view class="const_con">
+        <image
+          class="closePopup"
+          src="/static/f_close.png"
+          mode=""
+          @tap="closePopup"
+        ></image>
+        <view class="const_head flex_r flex_ac flex_jc">请选择兑换方式</view>
+        <view class="const_info">
+          <view class="frist_info flex_r flex_wrap">
+            <view
+              class="frist_list flex_c mar_b30"
+              v-for="(item, index) in way_list"
+              :key="index"
+              @tap="setCurrent(index)"
+            >
+              <view class="flex_r flex_ac">
+                <image
+                  class="frist_img"
+                  :src="
+                    currrent == index
+                      ? '/static/xuanzhong_icon.png'
+                      : '/static/weixuanzhong_icon.png'
+                  "
+                  mode=""
+                ></image>
+                <view class="frist_text">{{ item.name }}</view>
+              </view>
+              <view class="surplus">剩余({{ item.Integral }}积分)</view>
+            </view>
+          </view>
+          <view class="hint" v-if="isShow">积分不足请用余额或现金支付</view>
+          <view class="pay_way flex_r flex_ac flex_wrap mar_t30" v-if="isShow">
+            <view class="frist_list flex_c">
+              <view class="flex_r flex_ac" @tap="setPayWay(0)">
+                <image
+                  class="frist_img"
+                  :src="
+                    pay_way == 0
+                      ? '/static/xuanzhong_icon.png'
+                      : '/static/weixuanzhong_icon.png'
+                  "
+                  mode=""
+                ></image>
+                <view class="frist_text">余额</view>
+              </view>
+            </view>
+            <view class="frist_list flex_c">
+              <view class="flex_r flex_ac" @tap="setPayWay(1)">
+                <image
+                  class="frist_img"
+                  :src="
+                    pay_way == 1
+                      ? '/static/xuanzhong_icon.png'
+                      : '/static/weixuanzhong_icon.png'
+                  "
+                  mode=""
+                ></image>
+                <view class="frist_text">现金</view>
+              </view>
+            </view>
+          </view>
+          <checkbox-group
+            class="flex_r flex_ac flex_jc"
+            @change="checkboxChange"
+          >
+            <label class="option_box mar_t30">
+              <checkbox
+                value="1"
+                :checked="checked"
+                color="#2DB389"
+                style="transform: scale(0.7)"
+              />
+              我已阅读同意<text @tap.stop="getProPage">《购买协议》</text>
+            </label>
+          </checkbox-group>
+          <view class="conversion flex_r flex_ac flex_jc" @tap="confimConver"
+            >确认兑换</view
+          >
+        </view>
+      </view>
+    </uni-popup>
+    <!-- 兑换弹窗-end -->
+  </view>
+</template>
+
+<script>
+let page = 1;
+let app = getApp();
+// let reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+// import { ReqApi } from "@/utils/reqTools.js";
+import uniPopup from "@/components/uni-popup/uni-popup.vue";
+export default {
+  components: { uniPopup },
+  data() {
+    return {
+      list: [], // 积分商品
+      checked: false, //是否选中协议
+      currrent: 0, // 选中的兑换方式
+      pay_way: 0, //选中的支付方式
+      isShow: false, // 是否显示现金支付
+      goodsId: "", // 选中的商品Id
+    };
+  },
+  onShow: function () {
+    page = 1;
+    this.list = [];
+    this.loadData();
+  },
+  methods: {
+    loadData: function () {
+      this.loadGoods();
+      this.integralMethodChange();
+    },
+    // 获取轮播图
+    loadBacnner: function () {
+      let that = this;
+      const info = reqApi.integralLunBo();
+      if (info) {
+        info.then((res) => {
+          if (res.data.status == 200) {
+            that.imgArr = res.data.list;
+          }
+        });
+      }
+    },
+    // 获取积分专区商品列表
+    loadGoods: function () {
+      let that = this;
+      let data = {
+        page: page,
+        limit: 10,
+      };
+      const info = reqApi.getInteGoods(data);
+      if (info) {
+        info.then((res) => {
+          if (res.data.status == 200) {
+            let obj = res.data.goods;
+            if (obj.length > 0) {
+              for (var i in obj) {
+                that.list.push(obj[i]);
+              }
+            } else {
+              if (page == 1) {
+                that.haveGoods = true;
+                page = -1;
+              } else {
+                page = -1;
+                appEv.errTips("暂无更多");
+              }
+            }
+          } else {
+            if (page == 1) {
+              that.haveGoods = true;
+              page = -1;
+            } else {
+              page = -1;
+              appEv.errTips("暂无更多");
+            }
+          }
+        });
+      }
+    },
+    // 获取兑换方式
+    integralMethodChange: function () {
+      let that = this;
+      const info = reqApi.integralMethodChange();
+      if (info) {
+        info.then((res) => {
+          if (res.data.status == 200) {
+            that.way_list = res.data.data;
+          }
+        });
+      }
+    },
+    // 更改方式
+    setCurrent: function (e) {
+      this.currrent = e;
+      this.pay_way = "";
+      this.isShow = false;
+    },
+    // 更改支付方式
+    setPayWay: function (e) {
+      this.pay_way = e;
+    },
+    // 确认兑换
+    confimConver: function () {
+      let that = this;
+      let isShow = this.isShow;
+      let pay_way = this.pay_way;
+      let checked = this.checked;
+      let currrent = this.currrent;
+      if (currrent === "") {
+        appEv.errTips("请选择兑换方式");
+        return false;
+      }
+      if (isShow && pay_way === "") {
+        appEv.errTips("请选择支付方式");
+        return false;
+      }
+      if (!checked) {
+        appEv.errTips("请阅读并同意购买协议");
+        return false;
+      }
+      let data = {
+        goodsId: this.goodsId,
+        xyType: 1,
+        integralType: this.way_list[this.currrent].type,
+        count: 1,
+      };
+      if (isShow) {
+        data.jeType = this.pay_way == 0 ? 4 : 5;
+      } else {
+        data.jeType = 3;
+      }
+
+      const info = reqApi.integralClickExchange(data);
+      if (info) {
+        info.then((res) => {
+          if (res.data.status == 200) {
+            appEv.errTips(res.data.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.data.msg);
+            that.isShow = true;
+          }
+        });
+      }
+    },
+    // 更改协议选中情况
+    checkboxChange: function (e) {
+      let index = e.detail.value.indexOf("1");
+      if (index != -1) {
+        this.checked = true;
+      } else {
+        this.checked = false;
+      }
+    },
+    // 点击立即兑换打开弹窗
+    openConversion: function (e) {
+      this.goodsId = e;
+      this.$refs.conversion.open();
+    },
+    // 关闭立即兑换弹窗
+    closePopup: function () {
+      this.$refs.conversion.close();
+    },
+    getProPage: function () {
+      uni.navigateTo({
+        url: "/pages/protocol/index?type=" + 4,
+      });
+    },
+  },
+  onShareAppMessage: function () {
+    var path = "/pages/integral-list/index?agentId=1";
+    if (app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId) {
+      path = path + "?agentId=" + app.globalData.systemUserInfo.userId;
+    }
+
+    var title = `让数字经济赋能美好生活!`;
+    return {
+      title: title,
+      path: path,
+    };
+  },
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    if (page != -1) {
+      var that = this;
+      setTimeout(function () {
+        ++page;
+        that.loadData();
+      }, 800);
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+// 页面配置
+page {
+  background: #f4f4f4;
+}
+.container {
+  padding: 30rpx;
+  box-sizing: border-box;
+}
+// 页面配置-end
+
+// 顶部广告图
+.banner_top {
+  width: 100%;
+  height: 360rpx;
+}
+// 顶部广告图-end
+
+// 积分兑换
+.integral {
+  width: 100%;
+  overflow: hidden;
+}
+.integral_title {
+  width: 100%;
+  overflow: hidden;
+  padding: 30rpx 0;
+}
+.goods_info {
+  width: calc(100% - 300rpx - 40rpx);
+  overflow: hidden;
+}
+.goods_img {
+  width: 300rpx;
+  height: 208rpx;
+  border-radius: 12rpx;
+  margin-right: 40rpx;
+}
+.inte_icon {
+  width: 22rpx;
+  height: 22rpx;
+  border-radius: 50%;
+  border: 3rpx solid #1bbd89;
+  box-sizing: border-box;
+}
+.goods_name {
+  width: 100%;
+  overflow: hidden;
+  font-family: "SourceHanSansCN-Bold";
+  font-size: 28rpx;
+  color: #1a1a1a;
+}
+.inte_text {
+  font-size: 32rpx;
+  color: #232323;
+  font-family: "SourceHanSansCN-Medium";
+  font-weight: 500;
+  line-height: 1;
+  margin-left: 20rpx;
+}
+.msg {
+  width: 100%;
+  overflow: hidden;
+  color: #18ba87;
+  font-size: 26rpx;
+  margin-top: 16rpx;
+  margin-bottom: 22rpx;
+  font-family: "SourceHanSansCN-Medium";
+}
+.goods {
+  width: 100%;
+  overflow: hidden;
+  background: #fff;
+  border-radius: 12rpx;
+  margin-bottom: 18rpx;
+  padding: 18rpx;
+  box-sizing: border-box;
+  align-items: initial;
+}
+.info_btn {
+  width: 124rpx;
+  height: 40rpx;
+  background-color: #1bbd89;
+  border-radius: 8rpx;
+  color: #fff;
+  font-size: 22rpx;
+  font-family: "SourceHanSansCN-Bold";
+  font-weight: bold;
+}
+// 积分兑换-end
+
+// 兑换弹窗
+.option_box {
+  font-size: 26rpx;
+}
+.option_box text {
+  color: #2db389;
+}
+.hint {
+  font-size: 20rpx;
+  color: #d54912;
+}
+.pay_way {
+  width: 100%;
+  overflow: hidden;
+}
+.frist_list {
+  width: 50%;
+  overflow: hidden;
+}
+.surplus {
+  font-size: 22rpx;
+  color: #a8a8a8;
+}
+.frist_text {
+  font-size: 28rpx;
+  color: #302f2f;
+}
+.frist_img {
+  width: 35rpx;
+  height: 35rpx;
+  margin-right: 32rpx;
+}
+.frist_info {
+  width: 100%;
+  overflow: hidden;
+  align-items: initial;
+}
+.closePopup {
+  width: 42rpx;
+  height: 42rpx;
+  position: absolute;
+  right: 0;
+  top: -65rpx;
+}
+.const_con {
+  width: 689rpx;
+  border-radius: 10rpx;
+  background: #fff;
+  position: relative;
+}
+.const_info {
+  width: 100%;
+  overflow: hidden;
+  padding: 30rpx 50rpx;
+  box-sizing: border-box;
+}
+.const_head {
+  width: 100%;
+  height: 97rpx;
+  border-bottom: 3rpx solid rgba(0, 0, 0, 0.15);
+  font-size: 40rpx;
+  color: #1bbd89;
+  font-family: "SourceHanSansCN-Medium";
+}
+.conversion {
+  width: 269rpx;
+  height: 68rpx;
+  background: #1bbe8a;
+  font-family: "SourceHanSansCN-Medium";
+  color: #fff;
+  font-size: 32rpx;
+  border-radius: 34rpx;
+  margin: 40rpx auto 0;
+}
+// 兑换弹窗-end
+</style>

+ 230 - 0
src/pages/my-credites/index.vue

@@ -0,0 +1,230 @@
+<template>
+  <!--pages/goods-list/index.wxml-->
+  <view class="container">
+    <view class="content">
+      <view class="title flex_r flex_ac"> 茶宝 </view>
+      <view class="moeny flex_r flex_ac flex_jb">
+        <input
+          type="text"
+          :maxlength="12"
+          v-model="inputMoney"
+          placeholder="请输入兑换茶宝数量"
+        />
+        <view class="title_select">
+          <picker
+            @change="bindPickerChange"
+            :value="index"
+            :range="array"
+            :range-key="'source'"
+          >
+            <view class="flex_r flex_ac">
+              <view class="select_name">{{ array[index]["source"] }}</view>
+              <image
+                style="width: 25rpx; height: 25rpx; margin-left: 15rpx"
+                src="/static/down.png"
+                mode=""
+              ></image>
+            </view>
+          </picker>
+        </view>
+      </view>
+      <view class="option flex_r flex_ac flex_jb">
+        <view class="balance flex_r flex_ac">当前可用茶宝:{{ qxMoney }}</view>
+      </view>
+    </view>
+    <view class="btn flex_r flex_ac flex_jc" @tap="onSubForm">确定兑换</view>
+    <view class="showlist" v-for="(item, index) in show" :key="index"
+      >{{ index + 1 }}、{{ item }}</view
+    >
+  </view>
+</template>
+
+<script>
+let app = getApp();
+// var reqApi = new ReqApi();
+var appEv = app.$vm.$options;
+// var https = app.globalData.ShopUrl;
+// var util = require("../../utils/util.js");
+// import { ReqApi } from "../../utils/reqTools.js";
+export default {
+  data() {
+    return {
+      show: [],
+      qxMoney: 0.0,
+      inputMoney: "",
+      array: [{ name: "多分CHA", type: 12 }],
+      index: 0,
+      type: "", //兑换类型
+    };
+  },
+  onLoad: function (options) {
+    // this.qxMoney = 0.0;
+    // this.inputMoney = "";
+    // this.loadData();
+  },
+  methods: {
+    bindPickerChange: function (e) {
+      this.index = e.target.value;
+      this.type = this.array[index].type;
+    },
+    loadData() {
+      var that = this;
+      const cash = reqApi.integralType();
+      if (cash) {
+        cash.then((res) => {
+          if (res.data.status == 200) {
+            (that.qxMoney = res.data.integral), (that.show = res.data.show);
+            that.array = res.data.data;
+            this.type = res.data.data[0].type;
+          } else {
+            appEv.errTips(res.data.msg || "");
+          }
+        });
+      }
+    },
+
+    onSubForm() {
+      let that = this;
+      var priceTest = /^[0-9]+([.]{1}[0-9]{0,2}){0,1}$/;
+      if (this.inputMoney == "") {
+        appEv.errTips("请输入金额");
+        return;
+      }
+      if (
+        !priceTest.test(this.inputMoney) ||
+        parseFloat(this.inputMoney) <= 0
+      ) {
+        uni.showModal({
+          content: "请输入不超过3位小数的金额",
+          showCancel: false,
+          success(res) {},
+        });
+        return;
+      }
+
+      if (Number(this.inputMoney) > this.qxMoney) {
+        uni.showModal({
+          content: `当前可提现${that.qxMoney}`,
+          showCancel: false,
+          success(res) {},
+        });
+        return;
+      }
+      uni.showModal({
+        content: "是否进行茶宝兑换",
+        showCancel: false,
+        success: function (res) {
+          if (res.confirm) {
+            that.toCach();
+          } else if (res.cancel) {
+          }
+        },
+      });
+    },
+    toCach() {
+      let that = this;
+      var money = (Math.round(this.inputMoney * 100) / 100).toFixed(0);
+
+      console.log(money, that.type);
+      var cashApply = reqApi.exchangeIntegral({
+        integral: money,
+        type: that.type,
+      });
+      if (cashApply) {
+        cashApply.then((res) => {
+          uni.hideLoading();
+          if (res.data.status == 200) {
+            that.inputMoney = "";
+            appEv.errTips(res.data.msg);
+            that.loadData();
+          } else {
+            uni.showModal({
+              content: res.data.msg || "",
+              showCancel: false,
+              success(res) {},
+            });
+          }
+        });
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss">
+// 页面配置
+.container {
+  border-top: 20rpx solid #f5f5f5;
+  padding: 43rpx 30rpx;
+  box-sizing: border-box;
+}
+// 页面配置-end
+
+.title_select {
+  margin-left: 36rpx;
+}
+.select_name {
+  color: #2db48a;
+  font-size: 24rpx;
+}
+.balance {
+  font-size: 28rpx;
+  color: #7c838d;
+}
+.hint {
+  font-size: 26rpx;
+  color: #8f8f8f;
+  margin-top: 40rpx;
+}
+.title {
+  font-size: 28rpx;
+  color: #333333;
+  margin-bottom: 40rpx;
+}
+.showlist {
+  font-size: 26rpx;
+  color: #7c838d;
+  margin-bottom: 20rpx;
+}
+.moeny input {
+  color: #121922;
+  font-size: 32rpx;
+  height: 56rpx;
+  margin-left: 10rpx;
+}
+.upload_con {
+  width: 200rpx;
+  height: 200rpx;
+  border: 3rpx solid #898989;
+  border-radius: 10rpx;
+  margin-top: 60rpx;
+}
+.moeny {
+  font-size: 42rpx;
+  color: #121922;
+  line-height: 1;
+  height: 56rpx;
+  border-bottom: 3rpx solid #2db48a;
+  margin-bottom: 40rpx;
+  padding: 37rpx 0;
+}
+.content {
+  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
+  width: 100%;
+  overflow: hidden;
+  padding: 40rpx;
+  box-sizing: border-box;
+  border-radius: 20rpx;
+}
+.btn {
+  width: 348rpx;
+  height: 80rpx;
+  background: #18bb88;
+  color: #fff;
+  font-size: 40rpx;
+  border-radius: 10rpx;
+  box-shadow: 0px 8px 22px 2px rgba(24, 187, 136, 0.22);
+  margin: 64rpx auto;
+}
+</style>
+

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

@@ -19,7 +19,7 @@
 			<view class="price" :class="type == 2 ? 'samll' : ''">¥{{type == 2 ?detail.trade_price:detail.cost_price}}</view>
 			<view class="price_span flex_r flex_ac flex_je">
 				<view class="triangle"></view>
-				<view class="span_conten flex_r flex_ac flex_jc">{{goodsDa.type == 1 ? "零售专区" : goodsDa.type == 2 ? "批发专区" : goodsDa.type == 3 ? "精品专区" : "今日值买"}}</view>
+				<view class="span_conten flex_r flex_ac flex_jc">{{goodsDa.type == 1 ? "零售专区" : goodsDa.type == 2 ? "批发专区" : goodsDa.type == 3 ? "精品专区" : goodsDa.type == 4 ? "今日值买" : goodsDa.type == 5 ? "茶宝兑换" : ''}}</view>
 			</view>
 		</view>
 		<!-- 价格信息栏-end -->

+ 370 - 0
src/pages/product/productTeaBaby.vue

@@ -0,0 +1,370 @@
+<template>
+    <view class="container">
+        <!-- 商品列表 -->
+        <view class="goods_con flex_r flex_ac flex_wrap">
+            <view class="goods" v-for="(item,index) in goods" :key="index" @tap="NavToGoodsDetail(item.id)">
+                <image class="goods_img" :src="item.original_img" mode=""></image>
+                <view class="goods_info">
+                    <view class="info_title">{{item.goods_name}}</view>
+                    <!-- <view class="info_msg ellipsis">{{item.goodsMsg}}</view> -->
+                    <view class="info_option flex_r flex_ac flex_jb">
+                        <view class="info_price">{{item.price}} <text>茶宝</text></view>
+                        <!-- <image class="info_cart" src="/static/cart.png" mode="" @tap.stop="OpenShopping(index)"></image> -->
+                    </view>
+                    <!-- <view class="info_hint">赠送{{item.give_integral ? item.give_integral + '批发积分' : item.give_cha_bao + '茶宝'}}</view> -->
+                </view>
+            </view>
+        </view>
+        <!-- 商品列表-end -->
+
+    </view>
+</template>
+<script>
+let page = 1;
+let app = getApp();
+var appEv = app.$vm.$options;
+// let reqApi = new ReqApi();
+// import { ReqApi } from "@/utils/reqTools.js";
+import { get, post, u_post } from "@/request/api.js";
+import uniPopup from '@/components/uni-popup/uni-popup.vue'
+export default {
+    components: { uniPopup },
+    data() {
+        return {
+            goods: [], // 商品列表
+            goodsIndex: '', // 选中猜你喜欢的下标
+            buyNum: 1, // 购买数量
+            checked: false, // 是否同意协议
+            type: '',
+        };
+    },
+    onLoad(e) {
+        this.type = e.type
+    },
+    onShow() {
+        page = 1;
+        this.goods = [];
+        this.loadData()
+    },
+    methods: {
+        loadData() {
+            let that = this;
+            let data = {
+                page: page,
+                type: this.type
+            }
+            post("goods/goodsList", data).then(res => {
+                if (res.code === 0) {
+                    let obj = res.data.data
+                    if(page == 1) that.goods = []
+                    if (obj.length > 0) {
+                        obj.forEach(e => {
+                            that.goods.push(e)
+                        });
+                    } else {
+                        page = -1;
+                        appEv.errTips('暂无更多')
+                    }
+                } else {
+                    page = -1;
+                    appEv.errTips('暂无更多')
+                }
+
+            })
+        },
+        // 跳转到商品详情页
+        NavToGoodsDetail(id, type) {
+            uni.navigateTo({
+                url: '/pages/product/p_details?id=' + id + '&type=' + this.type
+            })
+        },
+        // 打开加入购物车窗口
+        OpenShopping(index) {
+            this.checked = false
+            this.goodsIndex = this.goods[index]
+            this.$refs.shopping.open()
+        },
+        // 购买数量更改
+        bindChange: function(e) {
+            this.buyNum = e;
+        },
+        // 点击关闭弹窗
+        closeBtn: function() {
+            this.$refs.shopping.close()
+        },
+        // 点击同意协议
+        checkboxChange: function(e) {
+            let index = e.detail.value.indexOf('1');
+            if (index != -1) {
+                this.checked = true
+            } else {
+                this.checked = false
+            }
+        },
+        // 点击添加购物车
+        ToPayPage: function() {
+            if (!this.checked) {
+                appEv.errTips('请勾选同意购买协议')
+                return false
+            }
+            let that = this;
+            let data = {
+                goodsId: this.goodsIndex.goodsId,
+                buyCount: this.buyNum,
+                specialArea: 1
+            }
+            const info = reqApi.conShoppingCart(data)
+            if (info) {
+                info.then(res => {
+                    if (res.data.status == 200) {
+                        appEv.errTips('添加成功')
+                        that.checked = false
+                        that.buyNum = 1
+                        that.$refs.shopping.close()
+                    } else {
+                        appEv.errTips(res.data.msg)
+                    }
+                })
+            }
+        },
+        getProPage: function() {
+            uni.navigateTo({
+                url: '/pages/protocol/index?type=' + 1
+            })
+        }
+    },
+    onShareAppMessage: function() {
+        let userinfo = uni.getStorageSync('userinfo');
+        var path = '/pages/product/productRetail?agentId=1';
+        if (userinfo.user_id) {
+            path = '/pages/product/productRetail?agentId=' + userinfo.user_id;
+        }
+        var title = `让数字经济赋能美好生活!`;
+        return {
+            title: title,
+            path: path
+        }
+    },
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+        if (page != -1) {
+            var that = this;
+            setTimeout(function() {
+                ++page;
+                that.loadData();
+            }, 800);
+        }
+    }
+}
+</script>
+<style lang="scss">
+// 页面配置
+page {
+    background: #F4F4F4;
+}
+
+.container {
+    padding: 22rpx 30rpx;
+    box-sizing: border-box;
+}
+
+// 页面配置-end
+
+// 商品列表
+.goods:nth-child(2n) {
+    margin-right: 0;
+}
+
+.info_cart {
+    width: 46rpx;
+    height: 45rpx;
+}
+
+.goods_con {
+    width: 100%;
+    overflow: hidden;
+}
+
+.info_hint {
+    font-size: 22rpx;
+    color: #787878;
+}
+
+.info_option {
+    width: 100%;
+    overflow: hidden;
+}
+
+.goods_img {
+    width: 100%;
+    height: 232rpx;
+    display: block;
+}
+
+.info_msg {
+    font-size: 24rpx;
+    color: #787878;
+    margin-top: 8rpx;
+}
+
+.goods_info {
+    padding: 20rpx 16rpx;
+    width: 100%;
+    box-sizing: border-box;
+}
+
+.info_price {
+    font-size: 32rpx;
+    color: #18BB87;
+    font-family: "SourceHanSansCN-Bold";
+}
+
+.info_title {
+    font-size: 28rpx;
+    color: #1B1A1A;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+}
+
+.info_price text {
+    font-size: 22rpx;
+    color: #18BB87;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+}
+
+.goods {
+    width: calc((100% - 22rpx) / 2);
+    overflow: hidden;
+    margin-right: 22rpx;
+    margin-bottom: 22rpx;
+    background: #fff;
+    border-radius: 12rpx;
+}
+
+// 商品列表-end
+
+// 购买或加入购物车弹窗
+.option_box text {
+    color: #2DB389;
+}
+
+.goods_raido {
+    margin-right: 180rpx;
+}
+
+.close_img {
+    width: 36rpx;
+    height: 36rpx;
+}
+
+.option_box {
+    font-size: 26rpx;
+    margin-top: 80rpx;
+}
+
+.goods_raido:nth-last-child(1) {
+    margin-right: 0;
+}
+
+.num_con {
+    width: 100%;
+    overflow: hidden;
+    padding-bottom: 3rpx;
+}
+
+.goods_option {
+    width: 100%;
+    overflow: hidden;
+    padding-top: 50rpx;
+}
+
+.close_con {
+    width: 100%;
+    overflow: hidden;
+    margin-bottom: 35rpx;
+}
+
+.raido_text {
+    font-size: 26rpx;
+    color: #545454;
+    margin-left: 30rpx;
+}
+
+.goods_cons {
+    width: calc(100% - 202rpx - 30rpx);
+    overflow: hidden;
+}
+
+.goods_imgs {
+    width: 202rpx;
+    height: 183rpx;
+    margin-right: 30rpx;
+    border-radius: 12rpx;
+}
+
+.confim {
+    width: 100%;
+    height: 60rpx;
+    border-radius: 30rpx;
+    background: #2DB389;
+    color: #fff;
+    font-size: 26rpx;
+    margin-top: 44rpx;
+}
+
+.shopping {
+    width: 100%;
+    overflow: hidden;
+    padding: 20rpx;
+    box-sizing: border-box;
+    border-radius: 30rpx 30rpx 0 0;
+    background: #fff;
+}
+
+.goods_infos {
+    width: 100%;
+    overflow: hidden;
+    align-items: inherit;
+    padding-bottom: 48rpx;
+    border-bottom: 3rpx solid rgba(0, 0, 0, .12);
+}
+
+.shop_names {
+    width: 100%;
+    overflow: hidden;
+    font-family: "SourceHanSansCN-Bold";
+    font-weight: bold;
+    color: #1B1B1B;
+    font-size: 32rpx;
+}
+
+.goods_msg {
+    width: 100%;
+    overflow: hidden;
+    font-size: 28rpx;
+    color: #18BB88;
+    font-family: "SourceHanSansCN-Medium";
+    font-weight: 500;
+}
+
+.raido_img {
+    width: 39rpx;
+    height: 35rpx;
+    background: url(~@/static/img/weixuanzhong.png);
+    background-repeat: no-repeat;
+    background-size: 35rpx 35rpx;
+    background-position: center center;
+}
+
+.raido_box {
+    background: url(~@/static/img/consent.png);
+    background-repeat: no-repeat;
+    background-size: 39rpx 35rpx;
+    background-position: center center;
+}
+
+// 购买或加入购物车弹窗-end
+</style>

+ 1 - 1
src/pages/sign/index.vue

@@ -24,7 +24,7 @@
                 </view>
                 <view class="info_today flex_c flex_ac">
                     <view class="today_text">{{todaySign}}</view>
-                    <view class="info_text">累计签到({{todaySign || 0}}次)</view>
+                    <view class="info_text">累计签到({{totalSign || 0}}次)</view>
                 </view>
                 <view class="info_con">
                     <image class="info_img" :src="nextSign> 0 ? '/static/sgin/p_back2.png' : '/static/sgin/p_back.png'" mode=""></image>

+ 8 - 0
src/request/request.js

@@ -65,6 +65,14 @@ uni.addInterceptor('request', {
 				icon: "none",
 			});
 		}
+
+		if(args.data.code === 301){
+			uni.showToast({
+				title: args.data.msg,
+				duration: 2000,
+				icon: "none",
+			});
+		}
 	},
 	fail(err) {
 		// console.log('interceptor-fail', err)			//请求失败