vaecebyZ vor 1 Jahr
Ursprung
Commit
072a5e610e
13 geänderte Dateien mit 1897 neuen und 341 gelöschten Zeilen
  1. 60 0
      api/activity.js
  2. 10 0
      api/common.js
  3. 1 1
      login/login/login.vue
  4. 252 0
      my/activityManage/index.vue
  5. 107 150
      my/order/detail.vue
  6. 192 162
      my/order/index.vue
  7. 24 0
      pages.json
  8. 175 25
      pages/activity/index.vue
  9. 6 1
      pages/my/index.vue
  10. 241 0
      signUp/index.vue
  11. 756 0
      signUp/makeOut.vue
  12. 2 2
      utils/config.js
  13. 71 0
      utils/upload.js

+ 60 - 0
api/activity.js

@@ -0,0 +1,60 @@
+import {request} from '@/utils/request.js'
+
+
+// 活动列表
+export function getActivityList(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignup/xcxSearch',
+		data
+	})
+}
+// 获取活动详情
+export function getActivityDetail(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignup/detail',
+		data
+	})
+}
+
+// 获取模板详情
+export function getTemplateDetail(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignupOrder/getContent',
+		data
+	})
+}
+
+// 报名
+export function signUp(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignupOrder/create',
+		method:'post',
+		data
+	})
+}
+
+// 计算价格
+export function calc(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignupOrder/calc',
+		data
+	})
+}
+
+// 创建订单
+export function createOrder(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignupOrder/order',
+		method:'post',
+		data
+	})
+}
+
+// 报名详情
+export function getOrderDetail(data) {
+	return request({
+		url: '/zswl-cloud-shop/activitySignupOrder/get',
+		data
+	})
+}
+

+ 10 - 0
api/common.js

@@ -148,6 +148,16 @@ export function finishUploadImg(data) {
 }
 
 
+// 上传正常图片
+export function finishUpload(data) {
+	return request({
+		url: '/zswl-cloud-bdb/user/finishUploadImg?type=2',
+		method:'post',
+		data
+	})
+}
+
+
 // 获取金刚区
 export function getMenu(data) {
 	return request({

+ 1 - 1
login/login/login.vue

@@ -81,7 +81,7 @@
  -->
     <view class="noticeTip">
       <u-radio-group size="30" v-model="value">
-        <u-radio :name="true"  shape="circle"></u-radio>
+        <u-radio  activeColor="#A20808" :name="true"  shape="circle"></u-radio>
         我已经已阅读并同意
         <!-- <text class="link">《用户协议》</text>和 -->
         <text class="link" @click="goReadme">《隐私政策》</text>

+ 252 - 0
my/activityManage/index.vue

@@ -0,0 +1,252 @@
+<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" 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>
+            <u-line :customStyle="{ marginTop: '20rpx' }"></u-line>
+            <view class="actionBox">
+              <view class="actionItem">
+                <view>活动介绍</view>
+              </view>
+              <view class="actionItem">
+                <view>报名记录</view>
+              </view>
+              <view class="actionItem">
+                <view>查看订单</view>
+              </view>
+            </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";
+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: 10,
+        activityEnable: 1,
+        state: null,
+      },
+      listStatus: "more", // more noMore loading
+
+    };
+  },
+  onShow() {
+    this.getList();
+    this.query.state = null;
+  },
+  created() {
+    this.navBarHeight = this.$navHight(1);
+    this.statusBarHeight = uni.getSystemInfoSync()["statusBarHeight"];
+    this.navBarHeight = this.navBarHeight + 10 + "px";
+  },
+  methods: {
+    getList() {
+      getActivityList({
+        shopId: this.shopId,
+        ...this.query,
+      }).then(res => {
+        this.list = 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++;
+        }
+      })
+    },
+    onClickStatus(item) {
+      this.query.state = item.value;
+      this.getList();
+    },
+    onClick(row) {
+      uni.navigateTo({
+        url: "/pages/activity/detail",
+      });
+    },
+    onRefresh() {
+      console.log("下拉刷新了", this.triggered);
+      this.triggered = true
+      setTimeout(() => {
+        this.triggered = false;
+      }, 1000)
+    },
+    loadMore() {
+      console.log("加载更多了");
+    },
+
+  },
+};
+</script>
+<style>
+page {
+  background-color: #fafafa;
+}
+</style>
+<style lang="scss" scoped>
+.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-top: 20rpx;
+    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>

+ 107 - 150
my/order/detail.vue

@@ -2,30 +2,19 @@
   <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.goodsList[0].goodsState == 'WAIT_PAYMENT' && !isNotTime">
+          等待支付,剩余<u-count-down :time="closeTime" format="HH:mm:ss" @finish="finish"></u-count-down>
         </view>
         <view class="status" v-else>
-          {{   filterType(info.goodsList[0].goodsState) }}
+          {{ filterType(info.goodsList[0].goodsState) }}
         </view>
       </view>
     </view>
 
-    <view
-      class="content progress"
-      v-if="
-        info.goodsList[0].goodsState == 'APPLY_REFUND' ||
-        info.goodsList[0].goodsState == 'REFUNDED'
-      "
-      @click="refundDetail"
-    >
+    <view class="content progress" v-if="
+      info.goodsList[0].goodsState == 'APPLY_REFUND' ||
+      info.goodsList[0].goodsState == 'REFUNDED'
+    " @click="refundDetail">
       <view class="progress-title"> 退款进度 </view>
 
       <view class="progress-desc"> 查看退款详情 </view>
@@ -34,11 +23,7 @@
 
     <view class="content info">
       <view class="order-info">
-        <image
-          class="icon"
-          :src="info.goodsList[0].goodsInfo.goodsPath"
-          mode=""
-        ></image>
+        <image class="icon" :src="info.goodsList[0].goodsInfo.goodsPath" mode=""></image>
         <view class="shop-info">
           <view class="title">
             {{ info.goodsList[0].goodsInfo.goodsName }}
@@ -60,7 +45,7 @@
       </view>
     </view>
 
-  
+
     <view class="input-box-address" @click="toMap()">
       <view class="label"> 到店自取地址 </view>
       <view class="value">
@@ -71,24 +56,17 @@
     </view>
 
 
-    <view
-      class="content code-box"
-      v-if="
-        info.goodsList[0].goodsState == 'WAIT_USE' &&
-        info.goodsList[0].goodsName != '二维码支付'
-      "
-    >
+    <view class="content code-box" v-if="
+      info.goodsList[0].goodsState == 'WAIT_USE' &&
+      info.goodsList[0].goodsName != '二维码支付'
+    ">
       <view class="left">
         <view class="title"> 券码信息 </view>
         <view class="codeNum"> </view>
       </view>
       <view class="code-btn" @click="checkCode">
         查看券码
-        <image
-          class="jiantou"
-          src="../../static/jiantou-icon.png"
-          mode=""
-        ></image>
+        <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
       </view>
     </view>
     <view class="content" v-if="info.goodsList[0].goodsState == 'USED'">
@@ -125,7 +103,7 @@
       <view class="item">
         <view class="label"> 付款方式 </view>
         <view class="value">
-          {{ filterPay(info.payment.paymentWay) || "未支付" }}
+          {{ info.payment.pay ? filterPay(info.payment.paymentWay) : "未支付" }}
         </view>
       </view>
       <view class="item">
@@ -137,13 +115,10 @@
         </view>
       </view>
 
-      <view
-        class="item"
-        v-if="
-          info.goodsList[0].goodsState != 'WAIT_PAYMENT' &&
-          info.goodsList[0].goodsState != 'CLOSE'
-        "
-      >
+      <view class="item" v-if="
+        info.goodsList[0].goodsState != 'WAIT_PAYMENT' &&
+        info.goodsList[0].goodsState != 'CLOSE'
+      ">
         <view class="label"> 支付时间 </view>
         <view class="value">
           {{ $u.timeFormat(info.payment.paymentTime, "yyyy-mm-dd hh:MM:ss") }}
@@ -154,7 +129,7 @@
         <view class="label"> 订单备注 </view>
         <view class="value">
           {{
-           info.extend.remark || "无"
+            info.extend.remark || "无"
           }}
         </view>
       </view>
@@ -198,56 +173,31 @@
           {{ info.goodsList[0].refundLog.remark }}
         </view>
       </view>
-      <button
-        type="default"
-        :loading="btnLoading"
-        v-if="!info.payment.transferAll"
-        class="pay-btn"
-        @click="cancelReply"
-      >
+      <button type="default" :loading="btnLoading" v-if="!info.payment.transferAll" class="pay-btn"
+        @click="cancelReply">
         取消退款
       </button>
     </template>
 
-    <button
-      type="default"
-      :loading="btnLoading"
-      class="pay-btn"
-      v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'"
-      @click="pay"
-    >
+    <button type="default" :loading="btnLoading" class="pay-btn" v-if="info.goodsList[0].goodsState == 'WAIT_PAYMENT'"
+      @click="pay">
       立即支付
     </button>
-    <view
-      class="content apply-box"
-      v-else-if="
-        (info.goodsList[0].goodsState == 'WAIT_USE' ||
-          info.goodsList[0].goodsState == 'USED') &&
-        isRefund()
-      "
-      @click="apply"
-    >
+    <view class="content apply-box" v-else-if="
+      (info.goodsList[0].goodsState == 'WAIT_USE' ||
+        info.goodsList[0].goodsState == 'USED') &&
+      isRefund()
+    " @click="apply">
       <view class="label"> 退款申请 </view>
       <view class="value"> 如引发商品争议,可申请平台介入处理 </view>
-      <image
-        class="jiantou"
-        src="../../static/jiantou-icon.png"
-        mode=""
-      ></image>
+      <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
     </view>
 
     <!-- 二维码 -->
     <u-overlay :show="show" v-if="show" :opacity="0.6">
       <view class="wrap" @click.stop="close">
-        <uqrcode
-          ref="uqrcode"
-          type="2d"
-          auto
-          canvas-id="qrcode"
-          :value="codeData"
-          :loading="loading"
-          :options="{ margin: 20 }"
-        >
+        <uqrcode ref="uqrcode" type="2d" auto canvas-id="qrcode" :value="codeData" :loading="loading"
+          :options="{ margin: 20 }">
           <template v-slot:loading>
             <text style="color: black">拼命加载中...</text>
           </template>
@@ -260,7 +210,6 @@
 <script>
 import { qrCode } from "@/api/order.js";
 import { payDetails, queryPayOrder, unRefund } from "@/api/payment.js";
-import { encodeURI } from "js-base64";
 export default {
   data() {
     return {
@@ -275,6 +224,7 @@ export default {
         goodsList: [{ goodsState: "" }],
         payment: {
           paymentWay: "",
+          pay: false
         },
         extend: "",
       },
@@ -289,7 +239,7 @@ export default {
     // }
   },
   filters: {
-   
+
   },
   computed: {
   },
@@ -318,6 +268,8 @@ export default {
         return "支付宝支付";
       } else if (val == "uac.miniOrder") {
         return "云闪付支付";
+      } else if (val == "wx.miniPreOrder") {
+        return "银联支付"
       } else {
         return "-";
       }
@@ -329,7 +281,7 @@ export default {
       } else if (
         this.info.goodsList[0].verifyModel &&
         new Date().getTime() <
-          this.info.goodsList[0].verifyModel.checkTime + 1000 * 60 * 60 * 48
+        this.info.goodsList[0].verifyModel.checkTime + 1000 * 60 * 60 * 48
       ) {
         // 已核销 并且没超过48小时
         return true;
@@ -392,24 +344,41 @@ export default {
     payDetails(orderNo) {
       payDetails(orderNo).then((res) => {
         this.info = res.content;
-        // try {
-        //   let extend = JSON.parse(this.info.extend);
-        //   if (extend.account) {
-        //     this.isVisual = true;
-        //   }
-        // } catch (e) {
-        //   //TODO handle the exception
-        // }
+        queryPayOrder(this.info.orderNo)
         this.info.extend = JSON.parse(this.info.goodsList[0].extend);
-        // 跳转了但是没支付
-        if(this.isJumped && this.info.goodsList[0].goodsState == "WAIT_PAYMENT"){
-          this.btnLoading = false;
-          uni.showToast({
-            title: "支付取消",
-            icon: "warning",
+        if (this.isJumped) {
+          this.isJumped = false;
+          const that = this;
+          let checkTime = 0;
+          uni.showLoading({
+            title: "支付中",
           });
-        }else{
-
+          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)
+                that.btnLoading = false;
+                uni.showToast({
+                  title: "订单查询失败",
+                  icon: "none",
+                });
+                uni.hideLoading();
+              }
+            });
+          }, 1000);
         }
       });
     },
@@ -436,66 +405,25 @@ export default {
         prepayid: miniPayRequest.prepayid,
       }))
 
-      console.log('prepayid :>> ', miniPayRequest.prepayid);
-      console.log('sign',miniPayRequest.sign);
-      console.log('path+query :>> ', `${miniPayRequest.minipath}?appPayReqest=${query}`);
-      console.log('appId', miniPayRequest.miniuser)
-			// 打开银联小程序
+      // 打开银联小程序
       uni.navigateToMiniProgram({
         appId: miniPayRequest.miniuser,
         path: `${miniPayRequest.minipath}?appPayRequest=${query}`,
         success: (res) => {
           // 打开成功
-          // console.log("打开成功", res);
           this.isJumped = true;
         },
         fail: (err) => {
           // console.log(err);
-					uni.hideLoading();
-					uni.showToast({
-							title: "支付失败",
-							icon: "none",
-						});
-						that.btnLoading = false
+          uni.hideLoading();
+          uni.showToast({
+            title: "取消支付",
+            icon: "none",
+          });
+          that.btnLoading = false
         },
       });
 
-      // uni.requestPayment({
-      // 	"provider": "wxpay",
-      // 	"orderInfo": miniPayRequest,
-      // 	"appid": "wxbc64403830bb13c5", // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
-      // 	"paySign": miniPayRequest.paySign,
-      // 	"nonceStr": miniPayRequest.nonceStr, // 随机字符串
-      // 	"package": miniPayRequest.package, // 固定值
-      // 	// "prepayid":  miniPayRequest.package, // 统一下单订单号
-      // 	"timeStamp": miniPayRequest.timeStamp, // 时间戳(单位:秒)
-      // 	"signType": miniPayRequest.signType, //签名算法
-      // 	success(msg) {
-      // 		console.log('msg', msg);
-      // 		queryPayOrder(that.info.orderNo).then(res1 => {
-      // 			if (res1.state == 'Success') {
-      // 				uni.hideLoading()
-      // 				uni.showToast({
-      // 					title: '支付成功',
-      // 					icon: 'success'
-      // 				})
-      // 				that.btnLoading = false
-      // 				that.payDetails(that.info.orderNo)
-      // 			}
-      // 		})
-      // 	},
-      // 	fail(e) {
-      // 		that.btnLoading = false
-      // 		uni.hideLoading()
-      // 		uni.showToast({
-      // 			title: '取消支付',
-      // 			icon: 'fail'
-      // 		})
-      // 		// 取消支付后,获取支付信息以备再次支付
-      // 		that.payDetails(that.info.orderNo)
-      // 		console.log('err', e,this);
-      // 	}
-      // })
     },
     // 取消退款申请
     cancelReply() {
@@ -518,7 +446,7 @@ export default {
       });
     },
   },
-  onReady() {},
+  onReady() { },
   onLoad(options) {
     this.info.orderNo = options.id;
   },
@@ -535,21 +463,26 @@ export default {
 .order-detail {
   background: #f9f9f9;
   min-height: 100vh;
+
   // padding-bottom: 100rpx;
   .status-box {
     padding: 24rpx 24rpx 4rpx;
     display: flex;
     justify-content: space-between;
+
     .text-box {
       color: #181818;
+
       .status {
         font-weight: bold;
         font-size: 32rpx;
         display: flex;
+
         .u-count-down__text {
           color: #ff4d3a !important;
         }
       }
+
       .notice {
         font-size: 24rpx;
         margin-top: 20rpx;
@@ -580,6 +513,7 @@ export default {
     border-radius: 16rpx;
     margin-top: -30rpx;
     box-sizing: border-box;
+
     .shop-name {
       font-weight: 600;
       font-size: 32rpx;
@@ -589,6 +523,7 @@ export default {
       overflow: hidden;
       text-overflow: ellipsis;
     }
+
     .address {
       font-weight: 300;
       font-size: 24rpx;
@@ -608,6 +543,7 @@ export default {
   .red {
     color: red !important;
   }
+
   .fs28 {
     font-size: 28rpx !important;
     font-weight: bold;
@@ -617,12 +553,14 @@ export default {
     display: flex;
     align-items: center;
     justify-content: space-between;
+
     .left {
       .title {
         font-weight: 500;
         font-size: 28rpx;
         color: #222222;
       }
+
       .codeNum {
         font-weight: 300;
         font-size: 24rpx;
@@ -630,12 +568,14 @@ export default {
         margin-top: 15rpx;
       }
     }
+
     .code-btn {
       display: flex;
       align-items: center;
       font-weight: 300;
       font-size: 24rpx;
       color: #aaaaaa;
+
       .jiantou {
         width: 24rpx;
         height: 24rpx;
@@ -651,6 +591,7 @@ export default {
     display: flex;
     align-items: center;
     justify-content: space-between;
+
     .label {
       color: #222;
       font-size: 28rpx;
@@ -689,26 +630,31 @@ export default {
     padding: 28rpx 24rpx;
     border-radius: 16rpx;
     background: #fff;
+
     .title {
       font-weight: 600;
       font-size: 28rpx;
       color: #222222;
     }
+
     .item {
       display: flex;
       align-items: center;
       justify-content: space-between;
       margin-top: 28rpx;
+
       .label {
         color: #222222;
         font-size: 28rpx;
       }
+
       .value {
         color: #999999;
         font-size: 28rpx;
       }
     }
   }
+
   .pay-btn {
     background: $uni-color-primary;
     width: 688rpx;
@@ -718,6 +664,7 @@ export default {
     color: #fff;
     margin-top: 50rpx;
   }
+
   .refund-box {
     .refund-msg {
       font-weight: 300;
@@ -727,13 +674,16 @@ export default {
       line-height: 40rpx;
     }
   }
+
   .apply-box {
     position: relative;
+
     .label {
       font-weight: 600;
       font-size: 28rpx;
       color: #222222;
     }
+
     .value {
       color: #999999;
       font-size: 24rpx;
@@ -749,15 +699,18 @@ export default {
       height: 24rpx;
     }
   }
+
   .info {
     .order-info {
       display: flex;
+
       .icon {
         width: 164rpx;
         height: 164rpx;
         border-radius: 16rpx;
         flex-shrink: 0;
       }
+
       .shop-info {
         display: flex;
         flex-direction: column;
@@ -765,6 +718,7 @@ export default {
         padding-left: 24rpx;
         flex: 1;
         box-sizing: border-box;
+
         .title {
           color: #181818;
           font-size: 28rpx;
@@ -773,16 +727,19 @@ export default {
           overflow: hidden;
           text-overflow: ellipsis;
         }
+
         .price-box {
           display: flex;
           align-items: center;
           justify-content: space-between;
+
           .price {
             color: #181818;
             font-size: 32rpx;
             font-weight: bold;
           }
         }
+
         .start-time,
         .goods-desc {
           font-size: 24rpx;

+ 192 - 162
my/order/index.vue

@@ -1,45 +1,47 @@
 <template>
 	<view class="order">
 		<view class="tab-box">
-			<view class="tab" :class="[query.orderType == null?'active':'']" @click="handleTab(null)">
+			<view class="tab" :class="[query.orderType == null ? 'active' : '']" @click="handleTab(null)">
 				全部
 			</view>
-		<!-- 	<view class="tab" :class="[query.orderType == 'USED'?'active':'']" @click="handleTab('USED')">
+			<!-- 	<view class="tab" :class="[query.orderType == 'USED'?'active':'']" @click="handleTab('USED')">
 				已使用
 			</view> -->
-			<view class="tab" :class="[query.orderType == 'WAIT_PAYMENT'?'active':'']" @click="handleTab('WAIT_PAYMENT')">
+			<view class="tab" :class="[query.orderType == 'WAIT_PAYMENT' ? 'active' : '']" @click="handleTab('WAIT_PAYMENT')">
 				待付款
 			</view>
-			<view class="tab" :class="[query.orderType == 'WAIT_USE'?'active':'']" @click="handleTab('WAIT_USE')">
+			<view class="tab" :class="[query.orderType == 'WAIT_USE' ? 'active' : '']" @click="handleTab('WAIT_USE')">
 				待使用
 			</view>
-			<view class="tab" :class="[query.orderType == 'APPLY_REFUND'?'active':'']" @click="handleTab('APPLY_REFUND')">
+			<view class="tab" :class="[query.orderType == 'APPLY_REFUND' ? 'active' : '']" @click="handleTab('APPLY_REFUND')">
 				退款
 			</view>
 		</view>
 		<u-empty v-if="!list.length && status == 'noMore'" mode="order" iconSize="200rpx" textSize="28rpx">
 		</u-empty>
 		<zs-list mt="0" @load="loadMore" :status="status">
-			<view class="order-item" v-for="(item,index) in list" :key="index" @click="jump(item)">
+			<view class="order-item" v-for="(item, index) in list" :key="index" @click="jump(item)">
 				<view class="top-box">
 					<view class="label">
-						{{item.shopInfo.shopName}}
+						{{ item.shopInfo.shopName }}
 					</view>
 					<view class="status">
-						{{item.goodsModelList[0].goodsState |filterType}}
+						{{ item.goodsModelList[0].goodsState | filterType }}
 					</view>
 				</view>
 				<view class="order-box">
-					<zs-img radius="full" :src="item.goodsModelList[0].goodsInfo.goodsPath" width="164rpx" height="164rpx"></zs-img>
+					<zs-img radius="full"
+						:src="item.goodsModelList[0].goodsInfo.goodsPath || item.goodsModelList[0].goodsInfo.activityCover"
+						width="164rpx" height="164rpx"></zs-img>
 					<view class="info">
 						<view class="title">
-							{{item.goodsModelList[0].goodsInfo.goodsName}}
+							{{ item.goodsModelList[0].goodsInfo.goodsName || item.goodsModelList[0].goodsInfo.activityName }}
 						</view>
 						<view class="time">
-							{{$u.timeFormat(item.createTime,'yyyy-mm-dd hh:MM:ss')}}
+							{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}
 						</view>
 						<view class="price">
-							¥{{item.payAmount}}
+							¥{{ item.payAmount }}
 						</view>
 					</view>
 				</view>
@@ -49,182 +51,210 @@
 </template>
 
 <script>
-	import {getOrderList} from '@/api/order.js'
-	export default {
-		data() {
-			return {
-				status: 'more',
-				loading: false,
-				query:{
-					orderType:null,
-					page:0,
-					size:10,
-					userId:JSON.parse(uni.getStorageSync('userInfo')).userId
-				},
-				total:0,
-				list: []
+import { getOrderList } from '@/api/order.js'
+export default {
+	data() {
+		return {
+			status: 'more',
+			loading: false,
+			query: {
+				orderType: null,
+				page: 0,
+				size: 10,
+				userId: JSON.parse(uni.getStorageSync('userInfo')).userId
+			},
+			total: 0,
+			list: []
+		}
+	},
+	filters: {
+		filterType: function (val) {
+			if (val == 'APPLY_REFUND') {
+				return '申请退款'
+			} else if (val == 'CLOSE') {
+				return '关闭订单'
+			} else if (val == 'REFUNDED') {
+				return '已退款'
+			} else if (val == 'REFUSAL_REFUND') {
+				return '拒绝退款'
+			} else if (val == 'USED') {
+				return '已使用'
+			} else if (val == 'WAIT_PAYMENT') {
+				return '待付款'
+			} else if (val == 'WAIT_USE') {
+				return '待使用'
 			}
+		}
+	},
+	methods: {
+		handleTab(val) {
+			this.query.orderType = val
+			this.query.page = 0
+			this.list = []
+			this.getOrderList()
 		},
-		filters: {
-			filterType: function(val) {
-				if(val == 'APPLY_REFUND'){
-					return '申请退款'
-				}else if(val == 'CLOSE'){
-					return '关闭订单'
-				}else if(val == 'REFUNDED'){
-					return '已退款'
-				}else if(val == 'REFUSAL_REFUND'){
-					return '拒绝退款'
-				}else if(val == 'USED'){
-					return '已使用'
-				}else if(val == 'WAIT_PAYMENT'){
-					return '待付款'
-				}else if(val == 'WAIT_USE'){
-					return '待使用'
-				}
-			}
+		loadMore() {
+			this.getOrderList()
+
 		},
-		methods: {
-			handleTab(val){
-				this.query.orderType = val
-				this.query.page = 0
-				this.list = []
-				this.getOrderList()
-			},
-			loadMore() {
-				this.getOrderList()
-				
-			},
-			jump(item) {
-				uni.setStorageSync('order',JSON.stringify(item))
-				uni.navigateTo({
-					url: './detail?id='+item.orderNo
+		jump(item) {
+			console.log('item',item);
+			
+			// 如果是活动则跳转到活动支付页
+			if (item.goodsModelList[0].goodsInfo.hasOwnProperty('activityEnable')) {
+				const enable = item.goodsModelList[0].goodsInfo.activityEnable
+				if(enable){
+					uni.navigateTo({
+					url: '/signUp/makeOut?id=' + item.activityId
 				})
-			},
-			getOrderList(){
-				this.status = 'loading'
-				getOrderList(this.query).then(res=>{
-					if(res.state == 'Success'){
-						this.total = res.content.totalElements
-						this.list = this.list.concat(res.content.content) 
-						this.list.length>=this.total?this.status = 'noMore':this.status = 'more'
-						this.query.page++
-						uni.stopPullDownRefresh()
-					}
+				}else{
+					uni.showToast({
+						title: '活动已结束',
+						icon: 'none'
+					})
+				}
+				return
+			} else {
+				uni.setStorageSync('order', JSON.stringify(item))
+				uni.navigateTo({
+					url: './detail?id=' + item.orderNo
 				})
 			}
 		},
-		onPullDownRefresh() {
-			this.query.page = 0
-			this.list = []
-			this.status = 'more'
-			this.getOrderList()
-		},
-		onLoad(option) {
-			this.query.orderType = option.type || null
+		getOrderList() {
+			this.status = 'loading'
+			getOrderList(this.query).then(res => {
+				if (res.state == 'Success') {
+					this.total = res.content.totalElements
+					this.list = this.list.concat(res.content.content)
+					this.list.length >= this.total ? this.status = 'noMore' : this.status = 'more'
+					this.query.page++
+					uni.stopPullDownRefresh()
+				}
+			})
 		}
+	},
+	onPullDownRefresh() {
+		this.query.page = 0
+		this.list = []
+		this.status = 'more'
+		this.getOrderList()
+	},
+	onLoad(option) {
+		this.query.orderType = option.type || null
 	}
+}
 </script>
 
 <style lang="scss">
-	.order {
-		background: #efefef;
-		padding: 90rpx 30rpx 0;
-		min-height: 100vh;
-		.tab-box{
-			display: flex;
-			position: fixed;
-			width: 750rpx;
-			height: 70rpx;
-			left: 0%;
-			top: 0%;
-			z-index: 9;
-			background: #fff;
-			
-			.tab{
-				flex: 1;
-				text-align: center;
-				padding: 15rpx 0;
-				font-size: 28rpx;
-				color: #999999;
+.order {
+	background: #efefef;
+	padding: 90rpx 30rpx 0;
+	min-height: 100vh;
+
+	.tab-box {
+		display: flex;
+		position: fixed;
+		width: 750rpx;
+		height: 70rpx;
+		left: 0%;
+		top: 0%;
+		z-index: 9;
+		background: #fff;
+
+		.tab {
+			flex: 1;
+			text-align: center;
+			padding: 15rpx 0;
+			font-size: 28rpx;
+			color: #999999;
+		}
+
+		.tab.active {
+			font-size: 32rpx;
+			color: #222222;
+			position: relative;
+
+			&::after {
+				content: '';
+				width: 40rpx;
+				height: 8rpx;
+				box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255, 255, 255, 0.16);
+				border-radius: 46rpx 46rpx 46rpx 46rpx;
+				background: $uni-color-primary;
+				position: absolute;
+				bottom: 0%;
+				left: 50%;
+				transform: translateX(-50%);
 			}
-			.tab.active{
-				font-size: 32rpx;
-				color: #222222;
-				position: relative;
-				&::after{
-					content: '';
-					width: 40rpx;
-					height: 8rpx;
-					box-shadow: inset 0rpx 6rpx 12rpx 2rpx rgba(255,255,255,0.16);
-					border-radius: 46rpx 46rpx 46rpx 46rpx;
-					background: $uni-color-primary;
-					position: absolute;
-					bottom: 0%;
-					left: 50%;
-					transform: translateX(-50%);
+		}
+	}
+
+	.zs-list {
+
+		.order-item {
+			background-color: #fff;
+			border-radius: 8px;
+			margin-bottom: 20rpx;
+
+			.top-box {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 20rpx;
+				border-bottom: 2rpx solid #F3F3F3;
+
+				.label {
+					font-weight: bold;
+					color: #222222;
+					font-size: 32rpx;
+					width: 500rpx;
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+
+				.status {
+					font-size: 28rpx;
+					color: #999999;
 				}
 			}
-		}
-		.zs-list {
 
-			.order-item {
-				background-color: #fff;
-				border-radius: 8px;
-				margin-bottom: 20rpx;
-				.top-box{
+			.order-box {
+				padding: 25rpx;
+				display: flex;
+
+				.icon {
+					width: 164rpx;
+					height: 164rpx;
+					border-radius: 16rpx;
+					background-color: #999;
+				}
+
+				.info {
+					margin-left: 25rpx;
 					display: flex;
+					flex-direction: column;
 					justify-content: space-between;
-					align-items: center;
-					padding: 20rpx;
-					border-bottom:2rpx solid #F3F3F3;
-					.label{
-						font-weight: bold;
-						color: #222222;
-						font-size: 32rpx;
-						width: 500rpx;
-						white-space: nowrap;
-						overflow: hidden;
-						text-overflow: ellipsis;
-					}
-					.status{
+
+					.title {
+						color: #0F0F0F;
 						font-size: 28rpx;
-						color: #999999;
 					}
-				}
-				.order-box {
-					padding: 25rpx;
-					display: flex;
 
-					.icon {
-						width: 164rpx;
-						height: 164rpx;
-						border-radius: 16rpx;
-						background-color: #999;
+					.time {
+						font-size: 26rpx;
+						color: #999999;
 					}
 
-					.info {
-						margin-left: 25rpx;
-						display: flex;
-						flex-direction: column;
-						justify-content: space-between;
-						.title {
-							color: #0F0F0F;
-							font-size: 28rpx;
-						}
-
-						.time {
-							font-size: 26rpx;
-							color: #999999;
-						}
-						.price{
-							font-weight: bold;
-							color: #181818;
-						}
-
+					.price {
+						font-weight: bold;
+						color: #181818;
 					}
+
 				}
 			}
 		}
 	}
+}
 </style>

+ 24 - 0
pages.json

@@ -101,6 +101,23 @@
 		}
 	],
 	"subPackages": [ //分包
+		{
+			"root": "signUp",
+			"pages": [
+				{
+					"path": "index",
+					"style": {
+						"navigationBarTitleText": "体验农耕文化,传承中国传统"
+					}
+				},
+				{
+					"path": "makeOut",
+					"style": {
+						"navigationBarTitleText": "填写资料"
+					}
+				}
+			]
+		},
 		{
 			"root": "activity",
 			"pages": [{
@@ -268,6 +285,13 @@
 						"navigationBarTitleText": "会员中心",
 						"navigationStyle": "custom"
 					}
+				},
+				{
+					"path": "activityManage/index",
+					"style": {
+						"navigationBarTitleText": "活动管理",
+						"navigationStyle": "custom"
+					}
 				}
 
 			]

+ 175 - 25
pages/activity/index.vue

@@ -1,36 +1,46 @@
 <template>
   <view class="content">
     <view class="navBarBox">
-      <view
-        class="statusBar"
-        :style="{ paddingTop: statusBarHeight + 'px' }"
-      ></view>
+      <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
       <view class="navBar">
         <view>活动</view>
         <image class="logo" mode="scaleToFill"></image>
       </view>
     </view>
-    <uni-card v-for="item in 2" :key="item" padding="0" spacing="0">
-      <view @click.stop="onClick">
-        <image
-          slot="cover"
-          class="cover"
-          src="https://oss.dev.zonelife.cn/static/guida/img/act/15519395654249311.jpg"
-        ></image>
-        <view class="content-box">
-          <view class="title">期待与生活与“粽”不同</view>
-          <view class="sub-title">
-            期待与生活与“粽”不同期待与生活与“粽”不同
+
+    <!-- <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" 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>
-      </view>
-    </uni-card>
+      </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";
 export default {
   components: {
     uniCard,
@@ -39,19 +49,90 @@ export default {
     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.getList();
+    this.query.state = null;
+  },
   created() {
     this.navBarHeight = this.$navHight(1);
     this.statusBarHeight = uni.getSystemInfoSync()["statusBarHeight"];
     this.navBarHeight = this.navBarHeight + 10 + "px";
   },
   methods: {
-    onClick() {
-      uni.navigateTo({
-        url: "/pages/activity/detail",
-      });
+    getList() {
+      getActivityList({
+        shopId: this.shopId,
+        ...this.query,
+      }).then(res => {
+        this.list = 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++;
+        }
+      })
+    },
+    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>
@@ -77,18 +158,63 @@ page {
   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: 300rpx;
+  height: 320rpx;
 }
+
 .content-box {
-  padding: 0 20rpx;
-  height: 110rpx;
+  padding: 10rpx 20rpx;
+  // height: 150rpx;
+
   .title {
     font-weight: bold;
+    color: black;
+    font-size: 32rpx;
     // 超出文本使用...
     overflow: hidden;
     text-overflow: ellipsis;
@@ -96,10 +222,34 @@ page {
   }
 
   .sub-title {
-    font-size: 20rpx;
+    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>

+ 6 - 1
pages/my/index.vue

@@ -30,7 +30,7 @@
       style="font-size: 34rpx; font-weight: bold; margin: 30rpx 0 20rpx 30rpx"
       >我的订单</view
     >
-    <u-grid :border="false" col="5" @click="click">
+    <u-grid :border="false" col="5">
       <u-grid-item
         v-for="(baseListItem, baseListIndex) in baseList"
         :key="baseListIndex"
@@ -121,6 +121,11 @@ export default {
         //   title: "会员码",
         //   // path: "../../my/memberCenter/index",
         // },
+        {
+          name: "activityManage",
+          title: "活动管理",
+          path: "../../my/activityManage/index",
+        },
         {
           name: "location",
           title: "收货地址",

+ 241 - 0
signUp/index.vue

@@ -0,0 +1,241 @@
+<template>
+	<view class="signUp">
+		<image class="good-img" :src="info.activityCover" mode="aspectFit"></image>
+		<view class="goods-info">
+			<view class="goods-name">
+				{{info.activityName}}
+			</view>
+			<view class="price-box" v-if="info.activityEnable == 1">
+				<view class="left">
+					<view class="unit">
+						¥
+					</view>
+					<view class="price">
+						{{info.price}}
+					</view>
+				</view>
+				
+			</view>
+		</view>
+		
+		<view class="list">
+			<view class="item">
+				<view class="label">
+					活动时间
+				</view>
+				<view class="value">
+					{{info.activityStartTime}} 至 {{info.activityEndTime}}
+				</view>
+			</view>
+			<view class="item" v-if="info.activityEnable == 1">
+				<view class="label">
+					报名时间
+				</view>
+				<view class="value">
+					{{info.signupStartTime}} 至 {{info.signupEndTime}}
+				</view>
+			</view>
+			<view class="item" v-if="info.address">
+				<view class="label">
+					活动地址
+				</view>
+				<view class="value">
+					{{info.address}}
+				</view>
+			</view>
+		</view>
+		
+		<view class="sub-title">
+			活动详情
+		</view>
+		<view class="desc-box">
+			<rich-text class="goods-desc" :nodes="info.activityDetail"></rich-text>
+		</view>
+		
+		
+		<view class="buy-box"  v-if="info.activityEnable == 1&&!isEnd">
+			<button class="buy-btn" type="default" @click="handleSignUp">报名</button>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {getActivityDetail} from '@/api/activity.js'
+	export default {
+		data() {
+			return {
+				id:0,
+				info: {},
+				isEnd:false
+			}
+		},
+		methods: {
+			handleSignUp(){
+				let that = this
+				let {activityStartTime,activityEndTime,limited,activityName,id,price,shopId} = this.info
+				let obj = {
+					activityStartTime,
+					activityEndTime,
+					limited,
+					activityName,
+					id,
+					price,
+					shopId
+				}
+				
+				if (uni.getStorageSync('token')) {
+					uni.setStorageSync('activity',JSON.stringify(obj) )
+					uni.navigateTo({
+						url:'/signUp/makeOut?id='+this.info.dataCollectId
+					})
+					
+				} else {
+					uni.showModal({
+						title:'请登录',
+						confirmText:'去登录',
+						success(res){
+							console.log(res);
+							if(res.confirm){
+								uni.navigateTo({
+									url:`/login/login/login?redirect=/signUp/index&scene=${that.id}`
+								})
+							}
+						}
+					})
+				}
+			},
+			getActivityDetail(id){
+				getActivityDetail({id}).then(res=>{
+					if (res.state == 'Success') {
+						this.info = res.content
+						this.info.activityDetail = res.content.activityDetail.replace(/<img/gi, '<img class="img_class" ')
+						uni.setNavigationBarTitle({
+							title:this.info.activityName
+						})
+						if(new Date(this.info.activityEndTime).getTime()< new Date().getTime() ){//活动结束
+							this.isEnd = true
+						}
+					}
+				})
+			}
+		},
+		onLoad(options) {
+			console.log('options',options);
+			this.id = decodeURIComponent(options.scene)
+			this.getActivityDetail(this.id)
+		}
+		
+	}
+</script>
+
+<style lang="scss" >
+.signUp{
+	background: #F9F9F9;
+	padding-bottom: 200rpx;
+	min-height: 100vh;
+	.good-img{
+		width: 100%;
+		height: 750rpx;
+		vertical-align: bottom;
+	}
+	.goods-info{
+		padding: 24rpx;
+		margin-bottom: 20rpx;
+		background: #fff;
+		.price-box{
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			margin-top: 20rpx;
+			.left{
+				display: flex;
+				align-items: flex-end;
+				.unit{
+					font-size: 20rpx;
+					color: $uni-color-primary;
+					font-weight: bold;
+				}
+				.price{
+					font-size: 36rpx;
+					color: $uni-color-primary;
+					font-weight: bold;
+				}
+				
+			}
+			
+		}
+		.goods-name{
+			font-size: 32rpx;
+			color: #222222;
+			font-weight: bold;
+		}
+		
+	}
+	
+	.sub-title{
+		font-weight: 600;
+		font-size: 28rpx;
+		color: #222222;
+		padding: 24rpx;
+		border-radius: 16rpx 16rpx 0 0;
+		background: #fff;
+	}
+	.desc-box{
+		.goods-desc{
+			color: #222222;
+			font-size: 24rpx;
+			.img_class{
+				max-width: 100%!important;
+				vertical-align: bottom;
+			}
+		}
+	}
+	
+	.list{
+		background: #fff;
+		margin-bottom: 20rpx;
+		.item{
+			padding: 24rpx;
+			border-top:1rpx solid #F0F0F0;
+			.label{
+				font-weight: 600;
+				font-size: 28rpx;
+				color: #222222;
+			}
+			.value{
+				font-weight: 300;
+				font-size: 24rpx;
+				color: #AAAAAA;
+				margin-top: 16rpx;
+				line-height: 40rpx;
+			}
+		}
+	}
+	
+	.buy-box{
+		position: fixed;
+		bottom: 0%;
+		left: 0%;
+		width: 100%;
+		background: #fff;
+		padding: 10rpx 24rpx env(safe-area-inset-bottom);
+		border-top: 1rpx solid #EEEEEE;
+		box-sizing: border-box;
+		.buy-btn{
+			width: 702rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: $uni-color-primary;
+			border-radius: 40rpx;
+			font-weight: 600;
+			font-size: 28rpx;
+			color: #FFFFFF;
+		}
+	
+		
+	}
+	
+}
+</style>

+ 756 - 0
signUp/makeOut.vue

@@ -0,0 +1,756 @@
+<template>
+	<view class="makeOut">
+		<view class="content signUp-info">
+			<view class="title">
+				{{activity.activityName}}
+			</view>
+			<view class="time">
+				活动时间:{{activity.activityStartTime}} 至 {{activity.activityEndTime}}
+			</view>
+			<view class="signUp-box">
+				<view class="label-box">
+					<view class="label">
+						报名人数
+					</view>
+					<view class="desc">
+						{{activity.limited?`(最多${activity.limited}人)`:'(不限制)'}}
+					</view>
+				</view>
+				<view class="num-box">
+					<view class="btn" :class="[num == 1?'disabled':'']" @click="add(-1)">
+						-
+					</view>
+					<view class="num">
+						{{num}}
+					</view>
+					<view class="btn" :class="[num == activity.limited?'disabled':'']" @click="add(1)">
+						+
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<view class="content" v-for="(test,d) in modelQuery">
+			<u--form
+				labelPosition="left"
+				:model="modelQuery[d]"
+				:rules="rules"
+				:ref="'uForm'+d"
+				labelWidth="150rpx"
+			>
+				<template v-for="(item,index) in setQuery.data">
+					<u-form-item
+						:label="item.dataName"
+						:prop="'data_'+index+'_value'"
+						:borderBottom="index != (setQuery.data.length-1)"
+						:required="item.requiredEnable == 1?true:false"
+						ref="item1"
+					>
+					
+						<u--input v-if="item.dataType == 1" :placeholder="'请输入'+item.dataName" :maxlength="getLength(item)" v-model="modelQuery[d][`data_${index}_value`]" border="none"></u--input>
+						<u-textarea v-else-if="item.dataType == 2" v-model="modelQuery[d][`data_${index}_value`]" border="surround" :maxlength="400" count ></u-textarea>
+						<u-radio-group  v-model="modelQuery[d][`data_${index}_value`]" v-else-if="item.dataType == 3">
+							<u-radio labelSize="34rpx" v-for="i in item.content" :key="i" :name="i" :label="i"></u-radio>
+						</u-radio-group>
+						<!-- <template v-else-if="item.dataType == 3">
+							<u--input @focus="handeChoose" :placeholder="'请选择'+item.dataName" v-model="modelQuery[d][`data_${index}_value`]" border="none"></u--input>
+						 <u-picker :show="show" ref="uPicker" closeOnClickOverlay :columns="[item.content]" @cancel="cancel" @confirm="confirm($event,d,index)"></u-picker>
+						</template> -->
+						 <u-checkbox-group
+							v-model="modelQuery[d][`data_${index}_value`]"
+							 v-else-if="item.dataType == 4"
+						>
+							<u-checkbox
+							 labelSize="34rpx"
+							 iconSize="34rpx"
+								v-for="i in item.content"
+								:key="index"
+								:label="i"
+								:name="i"
+							>
+							</u-checkbox>
+						</u-checkbox-group>
+						<u-upload
+							width="200rpx"
+							height="200rpx"
+							v-else-if="item.dataType == 5"
+							:fileList="modelQuery[d][`data_${index}_value`]"
+							@afterRead="afterRead($event,d,index)"
+							@delete="deletePic($event,modelQuery[d][`data_${index}_value`])"
+							@oversize="oversize($event,item)"
+							name="1"
+							:maxSize="item.size*1024*1024"
+							multiple
+							:maxCount="item.num"
+						></u-upload>
+					</u-form-item>
+				</template>
+			</u--form>
+		</view>
+		
+		<view class="btn-box">
+			<view class="left">
+				<view class="num">
+					共{{num}}人
+				</view>
+				<view class="total">
+					合计 <view class="price-box">
+						<view class="unit">
+							¥
+						</view>
+						<view class="price">
+							{{total}}
+						</view>
+					</view>
+				</view>
+			</view>
+			<button class="btn" @click="handleSignUp" :loading="loading">
+				立即报名
+			</button>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {getTemplateDetail,signUp,createOrder,calc} from '@/api/activity.js'
+	import {upload} from '@/utils/upload.js'
+	import {
+		creatPayOrder,
+		queryPayOrder,
+		payDetails
+	} from '@/api/payment.js'
+	export default {
+		data() {
+			return {
+				maxLength:40,
+				num: 1,
+				modelQuery:[{}],
+				setQuery:{},
+				activity:{},
+				rules: {},
+				loading:false,
+				show:false,
+				pickerObj:{
+					
+				},
+				isJumped: false,
+				price:0,
+				query: {
+					"msgType": "wx.miniPreOrder",
+					"orderDesc": "",
+					"orderNo": "",
+					"subOpenId": "",
+					"userId": ""
+				},
+				// 支付信息
+				payData: {}
+			}
+		},
+		computed: {
+			total() {
+				return this.price || this.activity.price
+			}
+		},
+		methods: {
+			handeChoose(){
+				this.show = true
+			},
+			cancel(){
+				this.show = false
+			},
+			confirm(val,d,index){
+				this.modelQuery[d][`data_${index}_value`] = val.value[0] 
+				this.show = false
+				console.log(val,d,index);
+			},
+			oversize(val,item){
+				console.log(val,item);
+				uni.showToast({
+					title:`请上传${item.size}MB以内的图片`,
+					icon:'none'
+				})
+			},
+			getLength(item){
+				if(item.validType == 1){
+					return 11 
+				}else if(item.validType == 2){
+					return 18
+				}else{
+					return 40
+				}
+			},
+			add(val){
+				if((val==-1&&this.num == 1)||(val==1&&this.num == this.activity.limited)) return
+				this.num += val
+				if(val == 1){
+					
+					let obj = {}
+					this.setQuery.data.map((item,index)=>{
+						if(item.dataType == 1){
+							// this.$set(this.modelQuery[this.modelQuery.length], `data_${index}_value`,'')
+							obj[`data_${index}_value`] = ''
+							
+						}else if(item.dataType == 2 ){
+							// this.$set(this.modelQuery[this.modelQuery.length], `data_${index}_value`,'')
+							obj[`data_${index}_value`] = ''
+						}
+						else if(item.dataType == 3 ){
+							// this.$set(this.modelQuery[this.modelQuery.length], `data_${index}_value`,'')
+							obj[`data_${index}_value`] = ''
+						}
+						else if(item.dataType == 4 ){
+							// this.$set(this.modelQuery[this.modelQuery.length], `data_${index}_value`,[])
+							obj[`data_${index}_value`] = []
+							
+						}else if( item.dataType == 5){
+							// this.$set(this.modelQuery[this.modelQuery.length], `data_${index}_value`,[])
+							obj[`data_${index}_value`] = []
+						}
+						
+					})
+					this.modelQuery.push(obj)
+					this.$nextTick(() => {
+					  this.$refs['uForm'+(this.modelQuery.length-1)][0].setRules(this.rules);
+					})
+				}else{
+					this.modelQuery.pop()
+				}
+				// 计算价格
+				calc({activityId:this.activity.id,num:this.num}).then(res=>{
+					if (res.state == 'Success') {
+						this.price = res.content.price
+					}
+				})
+				
+			},
+			getTemplateDetail(activityId){
+				getTemplateDetail({activityId}).then(res=>{
+					if (res.state == 'Success') {
+						this.setQuery = res.content.content
+						this.setQuery.data.map((item,index)=>{
+							if(item.dataType == 1){
+								// this.$set(item,'value','')
+								this.$set(this.modelQuery[0], `data_${index}_value`,'')
+								if(item.requiredEnable == 1){
+									let obj; //校验规则
+									if(item.validType == 0){
+										console.log(11111);
+										obj = {
+										  required: true,
+										  message: `请输入${item.dataName}`,
+										  trigger: ['blur']
+										}
+									}else if(item.validType == 1){
+										console.log(22222);
+										obj ={
+											pattern: /^[1][3,4,5,6,7,8,9][0-9]{9}$/,
+											message: '请输入正确的手机号'
+										}
+									}else if(item.validType == 2){
+										obj ={
+											len:18,
+											message: '请输入正确的身份证号'
+										}
+									}else if(item.validType == 3){
+										obj ={
+											pattern: /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]/,
+											// 正则检验前先将值转为字符串
+											transform(value) {
+												return String(value);
+											},
+											message: '请输入正确的邮箱'
+										}
+									}else if(item.validType == 4){
+										obj ={
+											pattern: /^(\-|\+)?\d+(\.\d+)?$/,
+											message: '只能输入数字'
+										}
+									}
+									
+									this.$set(this.rules, `data_${index}_value`, [{
+									  required: true,
+									  message: `请输入${item.dataName}`,
+									  trigger: ['blur']
+									},obj])
+								}
+							}else if(item.dataType == 2 ){
+								// this.$set(item,'value','')
+								this.$set(this.modelQuery[0], `data_${index}_value`,'')
+								if(item.requiredEnable == 1){
+									this.$set(this.rules, `data_${index}_value`, [{
+									  required: true,
+									  message: `请输入${item.dataName}`,
+									  trigger: ['blur']
+									}])
+								}
+							
+							}
+							else if(item.dataType == 3 ){
+								// this.$set(item,'value','')
+								this.$set(this.modelQuery[0], `data_${index}_value`,'')
+								if(item.requiredEnable == 1){
+									this.$set(this.rules, `data_${index}_value`, [{
+									  required: true,
+									  message: `请选择${item.dataName}`,
+									  trigger: ['blur','change']
+									}])
+								}
+								
+							}
+							else if(item.dataType == 4 ){
+								// this.$set(item,'value',[])
+								this.$set(this.modelQuery[0], `data_${index}_value`,[])
+								if(item.requiredEnable == 1){
+									this.$set(this.rules, `data_${index}_value`, [{
+									  type: 'array',
+									  required: true,
+									  message: `请选择${item.dataName}`,
+									  trigger: ['change']
+									}])
+								}
+								
+							}else if( item.dataType == 5){
+								// this.$set(item,'value',[])
+								this.$set(this.modelQuery[0], `data_${index}_value`,[])
+								if(item.requiredEnable == 1){
+									this.$set(this.rules, `data_${index}_value`, [{
+									  type: 'array',
+									  required: true,
+									  message: `请上传${item.dataName}`,
+									  trigger: ['change']
+									}])
+								}
+							}
+							
+						})
+							this.$nextTick(() => {
+								console.log( this.$refs.uForm0);
+							  this.$refs.uForm0[0].setRules(this.rules);
+							})
+						
+					}
+				})
+			},
+			// 删除图片
+			deletePic(event,data) {
+				data.splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event,d,index) {
+				console.log(event);
+			// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
+			let lists = [].concat(event.file)
+			let fileListLen = this.modelQuery[d][`data_${index}_value`].length
+			lists.map((item) => {
+				console.log(this.setQuery.data[index],this.setQuery.data[index].dataName);
+				this.modelQuery[d][`data_${index}_value`].push({
+					...item,
+					status: 'uploading',
+					message: '上传中'
+				})
+			
+			})
+			for (let i = 0; i < lists.length; i++) {
+				const result = await this.uploadFilePromise(lists[i])
+				let item = this.modelQuery[d][`data_${index}_value`][fileListLen]
+				
+				this.modelQuery[d][`data_${index}_value`].splice(fileListLen, 1, Object.assign(item, {
+					status: 'success',
+					message: '',
+					url: result
+				}))
+				
+				fileListLen++
+			}
+			},
+			uploadFilePromise(file) {
+				return new Promise((resolve, reject) => {
+					upload(file,'SHOP_INFO').then(res=>{
+						// this.form[key] = [{url:res}]
+						resolve(res)
+					})
+				})
+			},
+			formatData(){
+				console.log(this.modelQuery);
+			},
+			// 点击提交报名
+			handleSignUp(){
+				let obj = {
+				  "activitySignupId": this.activity.id,
+				  "dataInfos": [],
+				  "num": this.num,
+				  "userId": JSON.parse(uni.getStorageSync('userInfo')).userId
+				}
+				let arr = []
+				console.log( 11111111,this.modelQuery);
+				new Promise((resolve,reject)=>{
+					this.modelQuery.map((item,index)=>{
+						let personData = {data:[]}//每个人的填写数据
+						// 循环校验表单
+						this['a'+index] =  new Promise((resolve1,reject1)=>{
+							console.log( this.$refs['uForm' + index][0]);
+							if( Object.keys(this.rules).length){//有必填项
+							  this.$refs['uForm' + index][0].validate().then(res => {
+								  // 把每个人的资料全部放在personData的data属性里面  依次排列
+								  let dataItem
+									for(let key in item){
+										let i = key.split('_')[1]
+										console.log(item,i,this.setQuery.data[i]);
+										dataItem = JSON.parse(JSON.stringify(this.setQuery.data[i])) 
+										
+										// 值是数组直接赋值
+										if(Array.isArray(item[key])){
+											if(dataItem.dataType == 5){//取出图片里面的地址
+												dataItem.content = item[key].map(item1=>{ return item1.url})
+											}else{
+												dataItem.content = item[key]
+											}
+										}else{
+											dataItem.content = [item[key]]
+										}
+										personData.data.push(dataItem)
+									}
+									resolve1(1)
+									
+								}).catch(errors => {
+									console.log(errors);
+								})
+							}else{
+								// 把每个人的资料全部放在personData的data属性里面  依次排列
+								let dataItem
+								for(let key in item){
+									let i = key.split('_')[1]
+									console.log(item,i,this.setQuery.data[i]);
+									dataItem = JSON.parse(JSON.stringify(this.setQuery.data[i])) 
+									
+									// 值是数组直接赋值
+									if(Array.isArray(item[key])){
+										if(dataItem.dataType == 5){//取出图片里面的地址
+											dataItem.content = [item[key][0].url]
+										}else{
+											dataItem.content = item[key]
+										}
+									}else{
+										dataItem.content = [item[key]]
+									}
+									personData.data.push(dataItem)
+								}
+								resolve1(1)
+							}
+						})
+						obj.dataInfos.push(personData)
+						// 校验的promise数组 用于获取全部校验成功
+						arr.push(this['a'+index])
+						
+					})
+					// 全部校验成功
+					Promise.all(arr).then(res=>{
+						console.log('结果',res);
+						resolve()
+					}).catch(e=>{
+						console.log('报错',e);
+					})
+				}).then(()=>{
+					console.log(this.modelQuery,this.setQuery,obj)
+					this.signUp(obj).then(id=>{
+						this.creat(id)
+					})
+				})
+			},
+			signUp(obj){
+				return new Promise((resolve,reject)=>{
+					this.loading = true
+					signUp(obj).then(res=>{
+						this.loading = false
+						if (res.state == 'Success') {
+							resolve(res.content.serviceId)
+							// uni.hideLoading()
+							// uni.showToast({
+							// 	title:'报名成功',
+							// 	icon:'success'
+							// })
+							// uni.reLaunch({
+							// 	url: '/my/order/index'
+							// })
+						}
+					})
+				})
+			},
+			//创建订单
+			creat(serviceId) {
+				if (this.loading) return
+					this.loading = true
+					uni.showLoading({
+						title: '支付中'
+					})
+					let that = this
+					if (!this.payData.timeStamp) {
+						createOrder({
+							activityId: this.activity.id,
+							serviceId,
+							num:this.num,
+							userId: JSON.parse(uni.getStorageSync('userInfo')).userId
+						}).then(res => {
+							this.loading = false
+							if (res.state == 'Success') {
+								if (!this.activity.price) { //价格为0
+									uni.hideLoading()
+									uni.reLaunch({
+										url: '/my/order/index'
+									})
+								} else {
+									this.query.orderNo = res.content.orderNo
+									this.query.subOpenId = JSON.parse(uni.getStorageSync('userInfo')).openId
+									this.query.orderDesc = this.activity.activityName
+									creatPayOrder(this.query).then(data => {
+
+										that.payData = JSON.parse(data.content.miniPayRequest)
+
+										if (data.content.miniPayRequest == null) return uni.hideLoading()
+
+										let miniPayRequest = that.payData;
+										// miniPayRequest = JSON.parse(miniPayRequest);
+										
+										let query = encodeURIComponent(JSON.stringify({
+											sign: miniPayRequest.sign,
+											prepayid: miniPayRequest.prepayid,
+										}))
+
+										uni.navigateToMiniProgram({
+											appId: miniPayRequest.miniuser,
+											path: `${miniPayRequest.minipath}?appPayRequest=${query}`,
+											success: (res) => {
+												// 打开成功
+												// console.log("打开成功", res);
+												this.isJumped = true;
+											},
+											fail: (err) => {
+												// console.log(err);
+												uni.hideLoading();
+												uni.showToast({
+													title: "取消支付",
+													icon: "none",
+												});
+												that.btnLoading = false
+											},
+										});
+									})
+								}
+			
+							}
+						})
+					} else { // 取消支付后再次支付
+						uni.requestPayment({
+							"provider": "wxpay",
+							"orderInfo": that.payData,
+							"appid": that.payData.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
+							"paySign": that.payData.paySign,
+							"nonceStr": that.payData.nonceStr, // 随机字符串
+							"package": that.payData.package, // 固定值
+							// "prepayid":  that.payData.package, // 统一下单订单号 
+							"timeStamp": that.payData.timeStamp, // 时间戳(单位:秒)
+							"signType": that.payData.signType, //签名算法
+							success(msg) {
+								console.log('msg', msg);
+								queryPayOrder(that.query.orderNo).then(res1 => {
+									if (res1.state == 'Success') {
+										uni.hideLoading()
+										uni.reLaunch({
+											url: '/my/order/index'
+										})
+									}
+								})
+							},
+							fail(e) {
+								that.loading = false
+								uni.hideLoading()
+								uni.showToast({
+									title: '取消支付',
+									icon: 'fail'
+								})
+								// 取消支付后,获取支付信息以备再次支付
+								payDetails(that.query.orderNo).then(r => {
+									if (r.state == 'Success') {
+										that.payData = JSON.parse(r.content.miniPayRequest)
+									}
+								})
+								console.log('err', e);
+							}
+						})
+					}
+			}
+		},
+		onLoad(options) {
+			let userInfo = JSON.parse(uni.getStorageSync('userInfo'))
+			this.query.userId = userInfo.userId
+			// 如果从订单详情跳转则不会存在activity
+			this.activity = JSON.parse(uni.getStorageSync('activity'))
+			this.getTemplateDetail(this.activity.id)
+		}
+	}
+</script>
+
+<style lang="scss" >
+.makeOut{
+	background: #F9F9F9;
+	min-height: 100vh;
+	padding-top: 20rpx;
+	padding-bottom: 150rpx;
+	.content{
+		margin: 0 24rpx 20rpx;
+		padding: 28rpx 24rpx;
+		background: #fff;
+		box-sizing: border-box;
+		border-radius: 16rpx;
+	}
+	.signUp-info{
+		.title{
+			font-weight: 600;
+			font-size: 32rpx;
+			color: #181818;
+			overflow: hidden;
+			text-overflow: ellipsis;
+			/* 弹性伸缩盒子模型显示 */
+			display: -webkit-box;
+			/* 限制在一个块元素显示的文本的行数 */
+			-webkit-line-clamp: 2;
+			/* 设置或检索伸缩盒对象的子元素的排列方式 */
+			-webkit-box-orient: vertical;
+		}
+		.time{
+			font-weight: 300;
+			font-size: 24rpx;
+			color: #AAAAAA;
+			padding: 20rpx 0;
+			border-bottom: 1rpx solid #F0F0F0;
+		}
+		.signUp-box{
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding-top: 20rpx;
+			.label-box{
+				display: flex;
+				align-items: center;
+				.label{
+					font-weight: 300;
+					font-size: 24rpx;
+					color: #181818;
+				}
+				.desc{
+					font-weight: 300;
+					font-size: 24rpx;
+					color: #AAAAAA;
+				}
+			}
+			.num-box{
+				display: flex;
+				align-items: center;
+				.btn.disabled{
+					background: #F0F0F0;
+					color: #AAAAAA;
+				}
+				.btn{
+					width: 36rpx;
+					height: 36rpx;
+					line-height: 36rpx;
+					border-radius: 50%;
+					background: #FFEDEB;
+					color: $uni-color-primary;
+					font-size: 30rpx;
+					text-align: center;
+					vertical-align: top;
+				}
+				.num{
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #222222;
+					width: 50rpx;
+					text-align: center;
+					
+				}
+			}
+		}
+	}
+	.btn-box {
+		position: fixed;
+		bottom: 0%;
+		left: 0%;
+		z-index: 2;
+		width: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		box-sizing: border-box;
+		padding: 10rpx 24rpx env(safe-area-inset-bottom);
+		background: #fff;
+		border-top: 1rpx solid #EEEEEE;
+		.left{
+			display: flex;
+			align-items: flex-end;
+			.num{
+				font-weight: 300;
+				font-size: 24rpx;
+				color: #AAAAAA;
+			}
+			.total{
+				font-weight: 300;
+				font-size: 24rpx;
+				color: #222222;
+				display: flex;
+				align-items: flex-end;
+				margin-left: 6rpx;
+				.price-box{
+					display: flex;
+					align-items: flex-end;
+					font-weight: 400;
+					font-size: 32rpx;
+					color: #222222;
+					.unit{
+						font-size: 20rpx;
+					}
+				}
+			}
+		}
+	
+		.btn {
+			width: 280rpx;
+			height: 80rpx;
+			line-height: 80rpx;
+			text-align: center;
+			background: $uni-color-primary;
+			border-radius: 40rpx;
+			font-weight: 600;
+			font-size: 28rpx;
+			color: #FFFFFF;
+			margin: 0;
+		}
+	}
+	.u-form-item{
+		display: flex;
+		justify-content: flex-start;
+		.u-form-item__body__left{
+			align-self: flex-start !important;
+		}
+		.u-radio-group{
+			flex-wrap: wrap;
+		}
+		.u-radio,.u-checkbox{
+			margin-right: 20rpx;
+			margin-bottom: 20rpx;
+		}
+		.u-radio__icon-wrap--circle,.u-checkbox__icon-wrap--square{
+			width: 28rpx!important;
+			height: 28rpx!important;
+		}
+		.u-checkbox-group{
+			flex-wrap: wrap;
+			.u-radio,.u-checkbox-label--left{
+				margin-bottom: 20rpx;
+			}
+		}
+	}
+}
+</style>

+ 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';//生产视频会员店铺

+ 71 - 0
utils/upload.js

@@ -0,0 +1,71 @@
+import {
+	uploadImg,
+	finishUpload
+} from '@/api/common.js';
+import crypto from 'crypto-js';
+import {
+	Base64
+} from 'js-base64';
+
+export const upload = function(r,operate) {
+	return new Promise((resolve,reject)=>{
+		let suffix = r.url.split('.')[1]
+		uploadImg({
+			"fineName":  r.url.split('/')[3] + '.' + suffix,
+			operate
+		}).then(res => {
+			if (res.state == 'Success') {
+				const date = new Date();
+				date.setHours(date.getHours() + 1);
+				const policyText = {
+					expiration: date.toISOString(), // 设置policy过期时间。
+					conditions: [
+						// 限制上传大小。
+						["content-length-range", 0, 1024 * 1024 * 1024],
+					],
+				};
+
+
+				let fileName = r.name
+				const host = 'https://' + res.content.bucket + '.' + res.content.endPoint;
+				const policy = Base64.encode(JSON.stringify(policyText));
+				const signature = crypto.enc.Base64.stringify(crypto.HmacSHA1(policy, res.content.token
+					.accessKeySecret));;
+				const filePath = r.url; // 待上传文件的文件路径。
+				let paths = res.content.paths[0]
+				// paths.pop()
+				
+				uni.uploadFile({
+					url: host, // 开发者服务器的URL。
+					filePath: filePath,
+					name: 'file', // 必须填file。
+					formData: {
+						key: paths.join('/'),
+						policy,
+						success_action_status: '200', //让服务端返回200,不然,默认会返回204
+						OSSAccessKeyId: res.content.token.accessKeyId,
+						signature,
+						'x-oss-security-token': res.content.token.securityToken // 使用STS签名时必传。
+					},
+					success: (res1) => {
+						if (res1.statusCode === 200) {
+							console.log('上传成功');
+							// 告知服务器上传成功地址
+							finishUpload(
+								[{
+									path: res.content.paths[0],
+								}]).then(msg => {
+									resolve(host + '/' + paths.join('/'))
+							})
+						}
+					},
+					fail: err => {
+						console.log(err);
+					}
+				});
+
+
+			}
+		})
+	})
+}