vaecebyZ преди 1 година
родител
ревизия
db03e611b8
променени са 13 файла, в които са добавени 415 реда и са изтрити 86 реда
  1. 2 0
      login/login/login.vue
  2. 1 1
      my/activityManage/index.vue
  3. 58 34
      my/order/detail.vue
  4. 1 0
      my/order/index.vue
  5. 11 3
      my/order/refund.vue
  6. 11 4
      my/order/refundDetail.vue
  7. 1 1
      pages/activity/detail.vue
  8. 272 0
      pages/activity/index copy.vue
  9. 1 1
      pages/my/index.vue
  10. 1 0
      pay/pay.vue
  11. 1 0
      signUp/makeOut.vue
  12. 53 40
      signUp/orderDetail.vue
  13. 2 2
      utils/config.js

+ 2 - 0
login/login/login.vue

@@ -153,6 +153,8 @@ export default {
       getPhoneNum({
         code: val.detail.code,
       }).then((data) => {
+        if(data.state === 'Exception')  return
+
         this.userInfo.phone = data.content;
         getLoginToken({
           phoneNum: data.content,

+ 1 - 1
my/activityManage/index.vue

@@ -101,7 +101,7 @@ export default {
     this.navBarHeight = this.navBarHeight + 10 + "px";
   },
   methods: {
-    getList(where) {
+   async getList(where) {
       console.log('触发了!', where, this.query.currentPage);
       this.listStatus = "loading"
       if (!this.shopId) {

+ 58 - 34
my/order/detail.vue

@@ -2,11 +2,11 @@
   <view class="order-detail">
     <view class="status-box">
       <view class="text-box">
-        <view class="status" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT' && !isNotTime">
-          等待支付,剩余<u-count-down :time="closeTime" format="HH:mm:ss" @finish="finish"></u-count-down>
+        <view class="status" v-if="info.orderType == 'WAIT_PAYMENT' && !isNotTime">
+          等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
         </view>
-        <view class="status" v-else>
-          {{ filterType(info.goodsList[0].goodsState) }}
+        <view class="status" v-if="info.goodsList[0].goodsState != 'APPLY_REFUND' && info.goodsList[0].goodsState != 'REFUNDED'">
+          {{ filterType(info.orderType) }}
         </view>
       </view>
     </view>
@@ -242,6 +242,14 @@ export default {
 
   },
   computed: {
+    closeTime() {
+      // if((this.info.createTime + 1000*60*15) - new Date().getTime()){
+      // 	this.isNotTime = false
+      // }else{
+      // 	this.isNotTime = true
+      // }
+      return (this.info.createTime + 1000 * 60 * 30) - new Date().getTime()
+    },
   },
   methods: {
     filterType: function (val) {
@@ -257,6 +265,8 @@ export default {
         return "订单已完成";
       } else if (val == "WAIT_PAYMENT") {
         return "待付款";
+      } else if (val == "HAVE_PAID") {
+        return "待使用";
       } else if (val == "WAIT_USE") {
         return "待使用";
       }
@@ -344,7 +354,21 @@ export default {
     payDetails(orderNo) {
       payDetails(orderNo).then((res) => {
         this.info = res.content;
-        queryPayOrder(this.info.orderNo)
+        if (!this.info.payment) {
+          this.info.payment = {
+            paymentWay: "",
+            pay: false
+          }
+        }
+        queryPayOrder(this.info.orderNo).then(res => {
+          // console.log('res111',res);
+          if (res.state == "Fail") {
+            uni.showToast({
+              title: "支付信息获取失败,请稍后再试.",
+              icon: "none",
+            });
+          }
+        })
         this.info.extend = JSON.parse(this.info.goodsList[0].extend);
         if (this.isJumped) {
           this.isJumped = false;
@@ -355,41 +379,41 @@ export default {
           });
           const checkOrder = setInterval(() => {
             queryPayOrder(that.info.orderNo)
-            .then((res1) => {
-              // 支付成功
-              if (res1.content.status == "TRADE_SUCCESS") {
-                that.payDetails(that.info.orderNo);
-                uni.showToast({
-                  title: "支付成功!",
-                  icon: "none",
-                });
-                clearInterval(checkOrder)
-                uni.hideLoading();
-                that.btnLoading = false;
-              } else {
-                checkTime++;
-              }
-              if (checkTime > 5) {
-                clearInterval(checkOrder)
+              .then((res1) => {
+                // 支付成功
+                if (res1.content.status == "TRADE_SUCCESS") {
+                  that.payDetails(that.info.orderNo);
+                  uni.showToast({
+                    title: "支付成功!",
+                    icon: "none",
+                  });
+                  clearInterval(checkOrder)
+                  uni.hideLoading();
+                  that.btnLoading = false;
+                } else {
+                  checkTime++;
+                }
+                if (checkTime > 5) {
+                  clearInterval(checkOrder)
+                  that.btnLoading = false;
+                  uni.showToast({
+                    title: "订单查询失败",
+                    icon: "none",
+                  });
+                  uni.hideLoading();
+                }
+              }).catch(() => {
+                if (checkOrder) {
+                  clearInterval(checkOrder)
+                  checkOrder = null
+                }
                 that.btnLoading = false;
                 uni.showToast({
                   title: "订单查询失败",
                   icon: "none",
                 });
                 uni.hideLoading();
-              }
-            }).catch(() => {
-              if(checkOrder){
-                clearInterval(checkOrder)
-                checkOrder = null
-              }
-              that.btnLoading = false;
-              uni.showToast({
-                title: "订单查询失败",
-                icon: "none",
-              });
-              uni.hideLoading();
-            })
+              })
           }, 1000);
         }
       });

+ 1 - 0
my/order/index.vue

@@ -62,6 +62,7 @@ export default {
 				orderType: null,
 				page: 0,
 				size: 10,
+				channel:"GuiDa",
 				userId: JSON.parse(uni.getStorageSync('userInfo')).userId
 			},
 			activity: null,

+ 11 - 3
my/order/refund.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="refund">
-		<view class="shop-box">
+		<view  @click="toMap()" class="shop-box">
 			<view class="shop-name">
-				{{info.shopInfo.shopName}}
+				印象贵大文创店
 			</view>
 			<view class="address">
-				{{info.shopInfo.address}}
+				贵州大学西校区西一区体育场楼下
 			</view>
 		</view>
 
@@ -96,6 +96,14 @@ import {applyRefund} from '@/api/payment.js'
 			}
 		},
 		methods: {
+			toMap() {
+      uni.openLocation({
+        latitude: 26.4401,
+        longitude: 106.664,
+        name: "印象贵大文创店",
+        address: "贵州大学西校区西一区体育场楼下",
+      });
+    },
 			submit() {
 				this.$refs.query.validate().then(() => {
 					applyRefund(this.query).then(res=>{

+ 11 - 4
my/order/refundDetail.vue

@@ -14,12 +14,12 @@
 					</u-steps>
 			</view>
 			
-			<view class="content shop-box">
+			<view  @click="toMap()" class="content shop-box">
 				<view class="shop-name">
-					{{info.shopInfo.shopName}}
+					印象贵大文创店
 				</view>
 				<view class="address">
-					{{info.shopInfo.address}}
+					贵州大学西校区西一区体育场楼下
 				</view>
 			</view>
 			
@@ -177,7 +177,14 @@
 			}
 		},
 		methods: {
-	
+			toMap() {
+      uni.openLocation({
+        latitude: 26.4401,
+        longitude: 106.664,
+        name: "印象贵大文创店",
+        address: "贵州大学西校区西一区体育场楼下",
+      });
+    },
 			apply(){
 				let that = this
 				uni.navigateTo({

+ 1 - 1
pages/activity/detail.vue

@@ -15,7 +15,7 @@
     <view class="main-content">
       <rich-text :nodes="content"> </rich-text>
     </view>
-    <view v-if="inOpter" class="btn-box"> 报名 </view>
+    <!-- <view v-if="inOpter" class="btn-box"> 报名 </view> -->
   </view>
 </template>
 

+ 272 - 0
pages/activity/index copy.vue

@@ -0,0 +1,272 @@
+<template>
+  <view class="content">
+    <view class="navBarBox">
+      <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
+      <view class="navBar">
+        <view>活动</view>
+        <image class="logo" mode="scaleToFill"></image>
+      </view>
+    </view>
+
+    <!-- <view class="nvBarBox">
+      <view @click="onClickStatus(item)" v-for="item in status" :class="[query.state === item.value ? 'active' : '']">{{
+        item.name }}</view>
+    </view> -->
+
+    <zs-list mt="0" @load="loadMore" :status="listStatus">
+      <uni-card v-for="item in list" :key="item.activityCover" padding="0" spacing="0">
+        <view @click.stop="onClick(item)">
+          <view class='img-veiew'>
+            <!-- <view class="badge">{{ item.status }}</view> -->
+            <image slot="cover" class="cover" :src="item.activityCover">
+            </image>
+          </view>
+
+          <view class="content-box">
+            <view class="title">{{ item.activityName }}</view>
+            <view class="sub-title">
+              活动时间: {{ item.activityStartTime }} 至 {{ item.activityEndTime }}
+            </view>
+            <!-- <view class="sub-title">
+              活动地点:{{ item.address }}
+            </view> -->
+          </view>
+        </view>
+      </uni-card>
+    </zs-list>
+    <zs-tab-bar :value="1"></zs-tab-bar>
+  </view>
+</template>
+
+<script>
+import uniCard from "@/uni_modules/uni-card/components/uni-card/uni-card.vue";
+import { getActivityList } from "../../api/activity";
+import { GDZShopiID } from "../../utils/tool";
+export default {
+  components: {
+    uniCard,
+  },
+  data() {
+    return {
+      navBarHeight: 0,
+      statusBarHeight: 0,
+      list: [],
+      triggered: false,
+      loading: false,
+      status: [
+        // wait 未开始  doing 进行中   over 已结束
+        { name: "全部", value: null },
+        { name: "未开始", value: 'wait' },
+        { name: "进行中", value: 'doing' },
+        { name: "已结束", value: 'over' },
+      ],
+      shopId: uni.getStorageSync("gdShopId"),
+      query: {
+        currentPage: 1,
+        pageSize: 3,
+        activityEnable: 1,
+        state: null,
+      },
+      listStatus: "more", // more noMore loading
+
+    };
+  },
+  onShow() {
+    this.list = []
+    this.query = {
+      currentPage: 1,
+      pageSize: 3,
+      activityEnable: 1,
+      state: null,
+    }
+    this.getList();
+  },
+  created() {
+    this.navBarHeight = this.$navHight(1);
+    this.statusBarHeight = uni.getSystemInfoSync()["statusBarHeight"];
+    this.navBarHeight = this.navBarHeight + 10 + "px";
+  },
+  methods: {
+    async getList() {
+      this.listStatus = "loading"
+      if (!this.shopId) {
+        this.shopId = await GDZShopiID()
+      }
+      getActivityList({
+        shopId: this.shopId,
+        ...this.query,
+      }).then(res => {
+        this.list = this.list.concat(res.content.records);
+        this.loading = false;
+        // this.list = res.content.records;
+        let total = this.list.length
+        if (total >= res.content.total) {
+          this.listStatus = "noMore";
+        } else {
+          this.listStatus = "more";
+          this.query.currentPage = this.query.currentPage + 1;
+        }
+      })
+    },
+    onClickStatus(item) {
+      this.query.state = item.value;
+      this.getList();
+    },
+    onClick(row) {
+      // options.scene
+      if (uni.getStorageSync("token")) {
+        uni.navigateTo({
+          url: "/signUp/index?scene=" + row.id,
+        });
+      } else {
+        uni.showModal({
+          title: "请登录",
+          confirmText: "去登录",
+          success(res) {
+            console.log(res);
+            if (res.confirm) {
+              uni.navigateTo({
+                url: "../../login/login/login?redirect=/pages/activity/index",
+              });
+            }
+          },
+        });
+      }
+    },
+    onRefresh() {
+      console.log("下拉刷新了", this.triggered);
+      this.triggered = true
+      setTimeout(() => {
+        this.triggered = false;
+      }, 1000)
+    },
+    loadMore() {
+      this.getList();
+    },
+
+  },
+};
+</script>
+<style>
+page {
+  background-color: #fafafa;
+}
+</style>
+<style lang="scss" scoped>
+::v-deep .zs-list {
+  height: 80vh;
+  overflow-y: scroll;
+}
+
+
+.navBarBox .navBar .logo {
+  width: 0rpx;
+  height: 82rpx;
+  // margin-right: 10rpx;
+}
+
+.navBarBox .navBar {
+  font-size: 35rpx;
+  font-weight: bold;
+  padding: 3rpx 50rpx;
+  padding-bottom: 8rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+}
+
+.content {
+  // padding-top: 24%;
+}
+
+// .view-content {
+//   height: 600px;
+//   background-color: red;
+// }
+
+.nvBarBox {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  align-items: center;
+  // background-color: #fff;
+  padding: 10rpx 0;
+  font-size: 30rpx;
+  color: #999999;
+
+  .active {
+    color: #333333;
+    font-weight: bold;
+  }
+}
+
+.img-veiew {
+  position: relative;
+  overflow: hidden;
+
+  .badge {
+    position: absolute;
+    top: 0;
+    right: 0;
+    width: 120rpx;
+    text-align: center;
+    background-color: #DBDBDB;
+    color: #7A7A7A;
+    font-size: 24rpx;
+    padding: 5rpx 10rpx;
+  }
+
+}
+
+.cover {
+  width: 100%;
+  height: 320rpx;
+}
+
+.content-box {
+  padding: 10rpx 20rpx;
+  // height: 150rpx;
+
+  .title {
+    font-weight: bold;
+    color: black;
+    font-size: 32rpx;
+    // 超出文本使用...
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+
+  .sub-title {
+    font-size: 30rpx;
+    margin: 15rpx 0 30rpx 0;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+
+  .actionBox {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-around;
+    margin-top: 10rpx;
+
+    .actionItem {
+      width: 100%;
+      height: 100%;
+      display: flex;
+      justify-content: center;
+      font-size: 24rpx;
+      color: #212222;
+    }
+
+    // 前2个后面加线
+    .actionItem:nth-child(1),
+    .actionItem:nth-child(2) {
+      border-right: 1px solid #ccc;
+    }
+  }
+
+}
+</style>

+ 1 - 1
pages/my/index.vue

@@ -124,7 +124,7 @@ export default {
         {
           name: "activityManage",
           title: "活动管理",
-          path: "../../my/activityManage/index",
+          // path: "../../my/activityManage/index",
         },
         {
           name: "location",

+ 1 - 0
pay/pay.vue

@@ -238,6 +238,7 @@ export default {
               ? [this.payInfo.couponGoodsLogId]
               : [],
           extend,
+          channel:"GuiDa",
           goodsList: this.info.goodsId ? [this.info.goodsId] : [],
           idempotent: guid(),
           shopId: this.info.shopId,

+ 1 - 0
signUp/makeOut.vue

@@ -467,6 +467,7 @@ export default {
 				createOrder({
 					activityId: this.activity.id,
 					serviceId,
+					channel:"GuiDa",
 					num: this.num,
 					userId: JSON.parse(uni.getStorageSync('userInfo')).userId
 				}).then(res => {

+ 53 - 40
signUp/orderDetail.vue

@@ -2,12 +2,11 @@
   <view class="order-detail">
     <view class="status-box">
       <view class="text-box">
-        <!-- {{ info.orderType }} -->
-        <!-- <view class="status" v-if="info.orderType == 'WAIT_PAYMENT' && !isNotTime">
-          等待支付,剩余<u-count-down :time="closeTime" format="HH:mm:ss" @finish="finish"></u-count-down>
-        </view> -->
+        <view class="status" v-if="info.orderType == 'WAIT_PAYMENT' && !isNotTime">
+          等待支付,剩余<u-count-down :time="closeTime" format="mm:ss" @finish="finish"></u-count-down>
+        </view>
         <view class="status">
-          {{ filterType(info.orderType) }}
+          {{ filterType(info.orderType) || "订单错误" }}
         </view>
       </view>
     </view>
@@ -30,7 +29,8 @@
             {{ info.goodsList[0].goodsInfo.activityName }}
           </view>
           <view class="goods-desc">
-            活动时间: {{ info.goodsList[0].goodsInfo.activityStartTime }} 至 {{ info.goodsList[0].goodsInfo.activityEndTime }}
+            活动时间: {{ info.goodsList[0].goodsInfo.activityStartTime }} 至 {{ info.goodsList[0].goodsInfo.activityEndTime
+            }}
           </view>
           <view class="price-box">
             <view class="goods-desc">
@@ -93,8 +93,8 @@
             {{ o }}
           </view>
           <view class="value" v-else>
-            <image v-for="(img, index) in obj.value" :key="index" @click="clickImg(obj.value, index)" :src="img" mode="widthFix"
-              style="width: 150rpx; height: 150rpx;"></image>
+            <image v-for="(img, index) in obj.value" :key="index" @click="clickImg(obj.value, index)" :src="img"
+              mode="widthFix" style="width: 150rpx; height: 150rpx;"></image>
           </view>
         </view>
         <!-- uniapp 下划线 -->
@@ -259,6 +259,14 @@ export default {
 
   },
   computed: {
+    closeTime() {
+      // if((this.info.createTime + 1000*60*15) - new Date().getTime()){
+      // 	this.isNotTime = false
+      // }else{
+      // 	this.isNotTime = true
+      // }
+      return (this.info.createTime + 1000 * 60 * 30) - new Date().getTime()
+    },
   },
   methods: {
     clickImg(list, index) {
@@ -281,8 +289,8 @@ export default {
         return "订单已完成";
       } else if (val == "WAIT_PAYMENT") {
         return "待付款";
-      }else if (val == "HAVE_PAID") {
-        return "已付款";
+      } else if (val == "HAVE_PAID") {
+        return "待使用";
       } else if (val == "WAIT_USE") {
         return "待使用";
       }
@@ -370,8 +378,13 @@ export default {
     payDetails(orderNo) {
       payDetails(orderNo).then((res) => {
         this.info = res.content;
-        this.$forceUpdate()
-        if(this.info.payAmount > 0){
+        if (!this.info.payment) {
+          this.info.payment = {
+            paymentWay: "",
+            pay: false
+          }
+        }
+        if (this.info.payAmount > 0) {
           queryPayOrder(this.info.orderNo)
         }
         this.info.extend = JSON.parse(this.info.goodsList[0].extend);
@@ -421,41 +434,41 @@ export default {
           });
           let checkOrder = setInterval(() => {
             queryPayOrder(that.info.orderNo)
-            .then((res1) => {
-              // 支付成功
-              if (res1.content.status == "TRADE_SUCCESS") {
-                that.payDetails(that.info.orderNo);
-                uni.showToast({
-                  title: "支付成功!",
-                  icon: "none",
-                });
-                clearInterval(checkOrder)
-                uni.hideLoading();
-                that.btnLoading = false;
-              } else {
-                checkTime++;
-              }
-              if (checkTime > 5) {
-                clearInterval(checkOrder)
+              .then((res1) => {
+                // 支付成功
+                if (res1.content.status == "TRADE_SUCCESS") {
+                  that.payDetails(that.info.orderNo);
+                  uni.showToast({
+                    title: "支付成功!",
+                    icon: "none",
+                  });
+                  clearInterval(checkOrder)
+                  uni.hideLoading();
+                  that.btnLoading = false;
+                } else {
+                  checkTime++;
+                }
+                if (checkTime > 5) {
+                  clearInterval(checkOrder)
+                  that.btnLoading = false;
+                  uni.showToast({
+                    title: "订单查询失败",
+                    icon: "none",
+                  });
+                  uni.hideLoading();
+                }
+              }).catch(() => {
+                if (checkOrder) {
+                  clearInterval(checkOrder)
+                  checkOrder = null
+                }
                 that.btnLoading = false;
                 uni.showToast({
                   title: "订单查询失败",
                   icon: "none",
                 });
                 uni.hideLoading();
-              }
-            }).catch(() => {
-              if(checkOrder){
-                clearInterval(checkOrder)
-                checkOrder = null
-              }
-              that.btnLoading = false;
-              uni.showToast({
-                title: "订单查询失败",
-                icon: "none",
               });
-              uni.hideLoading();
-            });
           }, 1000);
         }
       });

+ 2 - 2
utils/config.js

@@ -1,5 +1,5 @@
-export const BASE_URL = 'https://api.dev.zonelife.cn';
-// export let BASE_URL = 'https://api.zonelife.cn';
+// export const BASE_URL = 'https://api.dev.zonelife.cn';
+export let BASE_URL = 'https://api.zonelife.cn';
 
 // export const SHOP_ID = '65aa19c3e2cc5b1095f087fc';//测试视频会员店铺
 export const SHOP_ID = '65aa17f980f6d56f44643a1f';//生产视频会员店铺