guhongwei 2 tahun lalu
induk
melakukan
99c213abe3
7 mengubah file dengan 42 tambahan dan 24 penghapusan
  1. 11 1
      app.json
  2. 1 1
      pages/match/matchadd.wxml
  3. 1 1
      pages/match/mess.js
  4. 2 2
      pages/match/mess.wxml
  5. 20 6
      pages/matchInfo/sign.js
  6. 6 13
      pages/matchInfo/sign.wxml
  7. 1 0
      utils/dict.js

+ 11 - 1
app.json

@@ -1,17 +1,24 @@
 {
     "pages": [
+    
+ 
+
         "pages/index/index",
         "pages/register/index",
         "pages/home/index",
         "pages/news/index",
         "pages/topic/index",
+
         "pages/my/index",
         "pages/my/userInfo",
+
         "pages/user/index",
         "pages/usermymatch/index",
+
         "pages/setting/index",
         "pages/setting/basic",
         "pages/setting/contact",
+
         "pages/match/index",
         "pages/match/mess",
         "pages/match/matchadd",
@@ -19,9 +26,12 @@
         "pages/match/projectadd",
         "pages/match/matchgroup",
         "pages/match/shteam",
+        "pages/match/sign",
+
         "pages/matchInfo/index",
         "pages/matchInfo/sign",
-        "pages/match/sign",
+      
+
         "pages/test/index"
     ],
     "usingComponents": {

+ 1 - 1
pages/match/matchadd.wxml

@@ -19,7 +19,7 @@
                 <view class="content">
                     <view class="label">比赛名称</view>
                     <view class="value">
-                        <input type="text" name="name" value="{{form.name}}" placeholder="请输入比赛名称" />
+                        <textarea name="name" value="{{form.name}}" auto-height placeholder="请输入比赛名称" />
                     </view>
                 </view>
                 <view class="content">

+ 1 - 1
pages/match/mess.js

@@ -31,7 +31,7 @@ Page({
     // 详情
     toView: function (e) {
         const { item } = e.currentTarget.dataset;
-        console.log(item);
+        wx.navigateTo({ url: `/pages/matchInfo/index?id=${item._id}` })
     },
     // 修改
     toEdit: function (e) {

+ 2 - 2
pages/match/mess.wxml

@@ -18,7 +18,7 @@
                             </view>
                             <view class="list_2">
                                 <view class="name">
-                                    <text class="status">{{item.status=='0'?'报名中':'暂无'}}</text>
+                                    <text class="status">{{item.status=='0'?'报名中':item.status=='1'?'报名截止':item.status=='2'?'报名结束':item.status=='3'?'发布秩序册':item.status=='4'?'比赛中':item.status=='5'?'比赛结束':'暂无'}}</text>
                                     <text>{{item.name}}</text>
                                 </view>
                                 <view class="other">
@@ -64,7 +64,7 @@
                     <view class="label">赛事状态</view>
                     <view class="value">
                         <picker mode="selector" bindchange="statusChange" value="{{form.status}}" name="status" range-key='value' range="{{statusList}}">
-                            <view class="input">{{form.status_name||'请选择赛事状态'}}</view>
+                            <view class="input">{{form.status=='0'?'报名中':form.status=='1'?'报名截止':form.status=='2'?'报名结束':form.status=='3'?'发布秩序册':form.status=='4'?'比赛中':form.status=='5'?'比赛结束':'请选择赛事状态'}}</view>
                         </picker>
                     </view>
                 </view>

+ 20 - 6
pages/matchInfo/sign.js

@@ -62,9 +62,7 @@ Page({
             }
         }
     },
-    toForward: function () {
-
-    },
+    toForward: function () { },
     // 支付
     toPay: async function () {
         const that = this;
@@ -72,9 +70,26 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async (res) => {
-                let obj = { openid: res.data.openid, money: 0.1, enroll_id: enroll._id }
+                let obj = { openid: res.data.openid, money: 0.1, enroll_id: enroll._id, type: '报名' }
                 const arr = await app.$post(`/newCourt/api/payOrder`, obj)
-                console.log(arr);
+                if (arr.errcode == '0') {
+                    wx.requestPayment({
+                        "timeStamp": arr.data.wxSign.timestamp,
+                        "nonceStr": arr.data.wxSign.nonceStr,
+                        "package": `prepay_id=${arr.data.wxSign.prepay_id}`,
+                        "signType": arr.data.wxSign.signType,
+                        "paySign": arr.data.wxSign.paySign,
+                        "success": async function (res) {
+                            wx.showToast({ title: `支付成功`, icon: 'success', duration: 2000 });
+                            const aee = await app.$post(`/newCourt/api/payOrder/${arr.data.data._id}`, { status: '1' });
+                            if (aee.errcode == '0') { that.watchLogin(); that.toclose(); that.back() }
+                        },
+                        "fail": function (res) {
+                            wx.showToast({ title: `支付未成功`, icon: 'error', duration: 2000 })
+                            that.watchLogin()
+                        },
+                    })
+                }
             },
             fail: async (res) => {
                 wx.redirectTo({ url: '/pages/index/index' });
@@ -162,6 +177,5 @@ Page({
      * 用户点击右上角分享
      */
     onShareAppMessage: function () {
-        console.log('1');
     },
 })

+ 6 - 13
pages/matchInfo/sign.wxml

@@ -2,11 +2,11 @@
     <view slot="info" class="container main">
         <view class="one">
             <form catchsubmit="onSubmit">
-                <view class="content">
+                <view class="content" style="display: none;">
                     <view class="label">openid</view>
                     <view class="value"><input name="openid" value="{{form.openid}}" placeholder="请输入openid" disabled /></view>
                 </view>
-                <view class="content">
+                <view class="content" style="display: none;">
                     <view class="label">比赛id</view>
                     <view class="value"><input name="match_id" value="{{form.match_id}}" placeholder="请输入比赛id" disabled /></view>
                 </view>
@@ -18,27 +18,20 @@
                     <view class="label">赛事分组</view>
                     <view class="value">
                         <picker mode="selector" bindchange="groupingChange" value="{{form.grouping_id}}" name="grouping_id" range-key='name' range="{{info.grouping}}">
-                            <view class="input">{{form.grouping_id||'请选择赛事分组'}}</view>
+                            <view class="input">{{form.grouping_name||'请选择赛事分组'}}</view>
                         </picker>
                     </view>
                 </view>
-                <view class="content">
-                    <view class="label">赛事分组名称</view>
-                    <view class="value"><input name="grouping_name" value="{{form.grouping_name}}" placeholder="请输入赛事分组名称" disabled /></view>
-                </view>
                 <view class="content">
                     <view class="label">组内项目</view>
                     <view class="value">
                         <picker mode="selector" bindchange="projectChange" value="{{form.project_id}}" name="project_id" range-key='name' range="{{projectList}}">
-                            <view class="input">{{form.project_id||'请选择组内项目'}}</view>
+                            <view class="input">{{form.project_name||'请选择组内项目'}}</view>
                         </picker>
                     </view>
                 </view>
-                <view class="content">
-                    <view class="label">组内项目名称</view>
-                    <view class="value"><input name="project_name" value="{{form.project_name}}" placeholder="请输入组内项目名称" disabled /></view>
-                </view>
-                <view wx:if="{{}}">
+                <view>
+                    {{form.project_id}}
                 </view>
                 <view class="btn">
                     <button type="primary" size="mini" form-type="submit">提交报名</button>

+ 1 - 0
utils/dict.js

@@ -25,6 +25,7 @@ export const matchType = [
 // -1:管理员,0:普通用户,1:裁判用户
 export const myBtn = [
     { title: '我的赛事', route: 'usermymatch', type: '0' },
+    { title: '我的订单', route: 'usermyorder', type: '0' },
     { title: '用户管理', route: 'user', type: '-1' },
     { title: '赛事管理', route: 'match', type: '-1' },
     { title: '订单管理', route: 'order', type: '-1' },