zhuliu 1 năm trước cách đây
mục cha
commit
adb8755a34

+ 18 - 0
api/user.js

@@ -9,4 +9,22 @@ module.exports={
   editPerson:(data)=>{
 		return request.post('/xiaoshi-weixinback/account/editPerson',data)
   },
+  //添加用户反馈
+  addUserFeedback:(data)=>{
+		return request.post('/xiaoshi-weixinback/userFeedBack/addUserFeedback',data)
+  },
+  //查看个人拥有的优惠券
+  queryPersonVoucher:(data)=>{
+		return request.post('/xiaoshi-weixinback/voucherManage/queryPersonVoucher',data)
+  },
+  //查看可购买的优惠券
+  queryVoucher:(data)=>{
+    var params = {
+      state:1,
+      ifAvailable:true,
+      ifExpiration:false,
+      getWay:1
+    }
+		return request.post('/xiaoshi-weixinback/voucherManage/queryVoucher',data || params)
+  },
  }

+ 6 - 2
app.json

@@ -29,7 +29,10 @@
     "pages/about/connection",
     "pages/webView/webView",
     "pages/productDetail/productDetail",
-    "pages/myWork/workDetail"
+    "pages/myWork/workDetail",
+    "pages/about/Feedback",
+    "pages/memberCenter/menberCenter2",
+    "pages/voucher/voucher"
   ],
   "tabBar": {
     "list": [
@@ -74,7 +77,8 @@
     "wux-fab-button": "/miniprogram_npm/wux-weapp/fab-button/index",
     "van-icon": "/miniprogram_npm/@vant/weapp/icon/index",
     "my-scroll-view": "/myComponents/scrollView/scrollView",
-    "my-icon": "/myComponents/icon/icon"
+    "my-icon": "/myComponents/icon/icon",
+    "myPay": "/myComponents/pay/pay"
   },
   "componentFramework": "glass-easel",
   "sitemapLocation": "sitemap.json",

+ 170 - 0
myComponents/pay/pay.js

@@ -0,0 +1,170 @@
+// myComponents/pay/pay.js
+const pay = require('../../utils/pay')
+const api = require('../../api/index')
+Component({
+
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    show:false,
+    data:{},
+    voucherShow:'暂无可用优惠券',
+    voucherTotal:0
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    //打开弹窗
+    show(data){
+      if(data.discount){
+        data.finalPrice = Number(data.price) * Number(data.discount)
+        data.discountPrice = Number(data.price) - data.finalPrice
+      }else{
+        data.finalPrice = Number(data.price) 
+        data.discountPrice = Number(data.price) - data.finalPrice
+      }
+      this.setData(
+        {
+          data:data,
+          show:true
+        }
+      )
+      this.setData(
+        {
+          ['data.discountText']:this.decimalToDiscount(this.data.data.discount)
+        }
+      )
+      if(this.data.data.type == -1 || this.data.data.type == 0 || this.data.data.type){
+        this.queryPersonVoucher()
+      }
+    },
+    decimalToDiscount(decimal){
+      // 确保输入是有效的数字,并且范围在0到1之间(包括0但不包括1)  
+      if (typeof decimal !== 'number' || isNaN(decimal) || decimal <= 0 || decimal >= 1) {  
+        return '' 
+      }  
+      // 将小数乘以10,四舍五入到最近的整数,并转换为字符串  
+      var discount = Math.round(decimal * 10);  
+      // 添加"折"字作为单位  
+      return discount + '折';  
+    },
+    //获取优惠券总数
+    queryPersonVoucher(){
+      var params = {
+        useScopes:[this.data.data.type]
+      }
+      api.queryPersonVoucher(params).then(res=>{
+        if(res.code == 200){
+          if(res.data.total>0){
+            this.setData(
+              {
+                voucherShow:`${res.data.total}张待使用券`,
+                voucherTotal:res.data.total
+              }
+            )
+          }else{
+            this.setData(
+              {
+                voucherShow:'暂无可用优惠券'
+              }
+            )
+          }
+          
+        }
+      })
+    },
+    //关闭弹窗
+    onClose(){
+      this.setData(
+        {
+          show:false
+        }
+      )
+      wx.showToast({
+        title: '取消支付',
+        icon: 'none' 
+      })
+    },
+    //查看优惠券
+    checkCoupons(){
+      var that = this
+      wx.navigateTo({
+        url: '/pages/voucher/voucher',
+        events: {
+          // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+          acceptDataFromVoucher: function(data) {
+            console.log(data)
+            var discountPrice = Number(data.discountPrice)
+            var totalPrice = Number(that.data.data.price)
+            var discount = Number(that.data.data.discount)
+            var finalPrice = 0
+            finalPrice =( totalPrice - discountPrice<=0)?0:totalPrice - discountPrice
+            if(discount){
+              finalPrice = finalPrice * discount
+            }
+            var voucherShow = ''
+            if(discountPrice >0){
+              voucherShow = `- ¥${discountPrice}`
+            }else if(that.data.voucherTotal > 0){
+              voucherShow = `${that.data.voucherTotal}张待使用券`
+            }else{
+              voucherShow='暂无可用优惠券'
+            }
+            that.setData(
+              {
+                ["data.personVoucherIds"]:data.chooseVoucher,
+                ["data.finalPrice"]:finalPrice,
+                ["data.discountPrice"]:totalPrice - finalPrice,
+                voucherShow:voucherShow
+              }
+            )
+          },
+        },
+        success: function(res) {
+          // 通过eventChannel向被打开页面传送数据
+          res.eventChannel.emit('acceptDataFromPay', { useScopes:that.data.data.type,chooseVoucher:that.data.data.personVoucherIds||[],totalPrice:that.data.data.price })
+        }
+      })
+    },
+    //支付
+    payMoney(){
+      var params = {
+        goods:this.data.data.goods,
+        servicePrice:this.data.data.servicePrice,
+        price:this.data.data.price,
+        discount:this.data.data.discount,
+        personVoucherIds:this.data.data.personVoucherIds,
+        // usedVouchers:this.data.data.servicePrice,
+        finalPrice:this.data.data.discount
+      }
+      wx.showLoading({
+        title: '加载中',
+      })
+      pay.payMoney(params).then(res=>{
+        if(res.errMsg == 'requestPayment:ok'){
+          wx.showToast({
+            title: '支付成功',
+          })
+          this.triggerEvent('success',this.data.data)
+          this.setData(
+            {
+              show:false
+            }
+          )
+        }
+      }).catch(error=>{
+  
+      })
+    },
+  }
+});

+ 8 - 0
myComponents/pay/pay.json

@@ -0,0 +1,8 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wux-divider": "/miniprogram_npm/wux-weapp/divider/index",
+    "van-popup": "/miniprogram_npm/@vant/weapp/popup/index",
+    "van-cell": "/miniprogram_npm/@vant/weapp/cell/index"
+  }
+}

+ 46 - 0
myComponents/pay/pay.wxml

@@ -0,0 +1,46 @@
+<!--myComponents/pay/pay.wxml-->
+<van-popup
+  show="{{ show }}"
+  closeable
+  round
+  position="bottom"
+  custom-style="height: auto;"
+  bind:close="onClose"
+>
+  <view class="popup">
+    <view class="content">
+      <view class="title">{{data.title}}</view>
+      <view>
+        <view class="cell">
+          <view class="cell_left">具体内容</view>
+          <view class="cell_right">
+            <span wx:for="{{data.goods}}">
+              {{item.name}} 
+              <span wx:if="{{item.price}}">(¥{{item.price}})</span> 
+              <span> x{{item.num}}</span>
+            </span>
+          </view>
+        </view>
+        <view class="cell" >
+          <view class="cell_left">折扣</view>
+          <view class="cell_right">{{data.discountText || '暂无折扣'}}</view>
+        </view>
+        <van-cell custom-class='vanCell' title="优惠券" is-link value="{{voucherShow}}" bind:click="checkCoupons"/>
+      </view>
+      <wux-divider wux-class="line" show-text="{{ false }}" />
+      <view class="cell">
+        <view class="cell_left">总计:</view>
+        <view class="cell_right">¥{{data.price}}</view>
+      </view>
+    </view>
+    
+     <view class="foot">
+      <view> <span wx:if="{{data.discountPrice}}">已优惠¥{{data.discountPrice}}</span></view>
+      <view class="foot_btn" bind:tap="payMoney">
+        <view class="foot_btn_price">¥{{data.finalPrice}}</view>
+        <view>立即支付</view>
+      </view>
+    </view>
+  </view>
+ 
+</van-popup>

+ 69 - 0
myComponents/pay/pay.wxss

@@ -0,0 +1,69 @@
+/* myComponents/pay/pay.wxss */
+.popup{
+  height: auto;
+  padding: 20rpx 25rpx 0 25rpx;
+}
+.content{
+  margin-top: 20px;
+  margin-bottom: 20px;
+  height: 250px;
+  overflow-y: auto;
+}
+.foot{
+  margin-bottom: 10px;
+  font-size: 26rpx;
+  padding-left: 10px;
+  color: white;
+  background: rgb(49, 46, 46);
+  width: calc(100% - 10px);
+  height: 50px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  border-radius: 50px ;
+}
+.foot_btn{
+  height: 100%;
+  border-radius: 0 50px 50px 0;
+  padding:0 10px;
+  background-color: var(--themeColor);
+  display: flex;
+  align-items: center;
+}
+.foot_btn_price{
+  margin-right: 10px;
+}
+.title{
+  text-align: center;
+  /* font-weight: bold; */
+  font-size: 30rpx;
+  margin-bottom: 15px;
+}
+
+
+
+.vanCell{
+  padding:15rpx 0 !important;
+  font-weight: bold;
+  font-size: 24rpx;
+}
+.vanCell::after{
+  border: 0 !important;
+}
+.line{
+  border-top: 2rpx solid darkgray !important;
+  margin-bottom: 5px !important;
+  margin-top: 0px !important;
+}
+.cell{
+  display: flex;
+  align-items: stretch;
+  justify-content: space-between;
+  font-weight: bold;
+  font-size: 24rpx;
+  margin-top: 10px;
+}
+.cell_left{
+  flex-shrink:0;
+  margin-right: 30px;
+}

+ 5 - 1
myComponents/table/table.js

@@ -19,7 +19,11 @@ Component({
       },
       onclick: {
         type: String
-    }
+      },
+      tdStyle:{
+        type:String,
+        value:''
+      }
   },
 
   /**

+ 1 - 1
myComponents/table/table.wxml

@@ -5,7 +5,7 @@
             <view class="th" wx:for="{{thead}}" wx:key="index">{{item.name}}</view>
         </view>
         <view class="tr" wx:for="{{data}}" wx:for-item="row" wx:key="index">
-            <view class="td" wx:for="{{thead}}" bindtap="onclick" data-row="{{row}}" wx:key="index">{{row[item.key]}}</view>
+            <view class="td" style="{{tdStyle}}" wx:for="{{thead}}" bindtap="onclick" data-row="{{row}}" wx:key="index">{{row[item.key]}}</view>
         </view>
     </view>
 </view>

+ 2 - 2
myComponents/table/table.wxss

@@ -6,7 +6,7 @@
 }
 
 .table {
-  margin: 0 auto;
+  /* margin: 0 auto; */
   display: table;
   border-collapse: collapse;
   overflow-x: auto;
@@ -38,7 +38,7 @@
   padding: 0rpx 30rpx;
   display: table-cell;
   height: 60rpx;
-
+  width: 60px;
   line-height: 60rpx;
   text-align: center;
   border: 1rpx solid #DDDDDD;

+ 157 - 0
pages/about/Feedback.js

@@ -0,0 +1,157 @@
+// pages/about/Feedback.js
+const upload = require("../../utils/upload")
+const api = require('../../api/index')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    fileList:[],
+    form:{}
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+
+  //修改数据
+  changeValue(e){
+    var {field} = e.currentTarget.dataset
+    var value = e.detail.value
+    this.setData(
+      {
+        ["form."+field]:value
+      }
+    )
+  },
+  //上传文件
+  beforeUpload(e){
+    if(e.detail.errMsg=="chooseMedia:ok"){
+      // var data = [{
+      //   status: 'done',
+      //   url: e.detail.tempFiles[0].tempFilePath,
+      // }]
+      var that = this
+      var tempFilePaths = e.detail.tempFiles
+      tempFilePaths.forEach(item=>{
+        let tempFilePath = item.tempFilePath
+        // this.setData({ imageUrl:e.detail.tempFiles[0].tempFilePath })
+        upload.upload(tempFilePath).then(res=>{
+          if(res.code == 200){
+            // var arr = []
+            // arr.push(res.data[0])
+            var guid = res.data[0]
+            var arr = that.data.fileList
+            arr.push(
+              {
+                url:tempFilePath,
+                guid:guid,
+                status:"done"
+              }
+            )
+            that.setData(
+              {
+                // ["form.fileGuids"]:arr
+                fileList:arr
+              }
+            )
+          }
+        })
+      })
+      
+    }
+  },
+  //移除
+  onRemove(e){
+    const { file, fileList } = e.detail
+    wx.showModal({
+      content: '确定删除?',
+      success: (res) => {
+        if (res.confirm) {
+          this.setData({
+            fileList: this.data.fileList.filter((n) => n.guid !== file.guid),
+          })
+        }
+      },
+    })
+  },
+  //提交
+  submit(){
+    if(!this.data.form.feedbackContent){
+      wx.showToast({
+        title: '请输入您的问题',
+        icon:'none'
+      })
+      return
+    }
+    var params = this.data.form
+    params.fileGuids=this.data.fileList.map(item=>item.guid)
+    wx.showLoading({
+      title: '加载中',
+    })
+    api.addUserFeedback(params).then(res=>{
+      if(res.code == 200){
+        wx.showToast({
+          title: '提交成功',
+        })
+        wx.navigateBack()
+      }
+    })
+    
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 6 - 0
pages/about/Feedback.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "wux-textarea":"/miniprogram_npm/wux-weapp/textarea",
+    "wux-upload": "/miniprogram_npm/wux-weapp/upload/index"
+  }
+}

+ 47 - 0
pages/about/Feedback.wxml

@@ -0,0 +1,47 @@
+<!--pages/about/Feedback.wxml-->
+<view class="Feedback">
+  <view class="content">
+    <view class="title">问题和意见</view>
+    <view class="details">
+      <wux-textarea
+          rows="3"
+          value="{{ form.feedbackContent }}" 
+          data-field='feedbackContent'
+          bind:change="changeValue"
+          placeholder="请填写问题描述以便我们提供更好的帮助"
+        />
+    </view>
+  </view>
+  <view class="content">
+    <view class="title">图片(选填,提供问题截图)</view>
+    <view class="details">
+      <wux-upload
+            listType="picture-card"
+            fileList="{{ fileList }}"
+            controlled
+            uploaded="false"
+            bind:before="beforeUpload"
+            bind:preview="onPreview"
+            bind:remove="onRemove"
+          >
+            <text>+</text>
+          </wux-upload>
+    </view>
+  </view>
+  <view class="content">
+    <view class="title">邮箱(选填)</view>
+    <view class="details">
+      <wux-textarea
+          rows="1"
+          value="{{ form.email }}" 
+          data-field='email'
+          bind:change="changeValue"
+          placeholder="请输入您的邮箱"
+        />
+    </view>
+  </view>
+  <view class="foot" bind:tap="submit">
+      提交
+  </view>
+</view>
+

+ 24 - 0
pages/about/Feedback.wxss

@@ -0,0 +1,24 @@
+/* pages/about/Feedback.wxss */
+.Feedback{
+  padding: 10px;
+}
+.content{
+
+}
+.title{
+  padding: 8px 0;
+  color:dimgray;
+}
+.details{
+  border:1px solid var(--themeColor);
+  border-radius: 5px;
+  padding: 5px;
+}
+.foot{
+  margin-top: 20px;
+  padding: 15rpx 25rpx;
+  background-color: var(--themeColor);
+  color: #ffffff;
+  text-align: center;
+  border-radius: 15rpx;
+}

+ 6 - 0
pages/about/about.js

@@ -15,6 +15,12 @@ Page({
         page:'/pages/about/introduce'
       },
       {
+        type:3,
+        label:'意见反馈',
+        icon:'',
+        page:'/pages/about/Feedback'
+      },
+      {
         type:2,
         label:'联系我们',
         icon:'',

+ 1 - 0
pages/memberCenter/memberCenter.js

@@ -214,6 +214,7 @@ Page({
           top:wx.getStorageSync('height')
         }
       )
+      return
     }
     var params = {
       goodType:1,

+ 240 - 0
pages/memberCenter/menberCenter2.js

@@ -0,0 +1,240 @@
+// pages/memberCenter/menberCenter2.js
+const api = require('../../api/index')
+const pay = require('../../utils/pay')
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    localImagePath:app.globalData.localImagePath,
+    imgHttp:app.globalData.imghttp,
+    userinfo:{},
+    vipType:[
+      {
+        name:'1个月',
+        price:'20',
+        // currentPrice:'20',
+        description:'开通1个月会员,享尊贵特权'
+      },
+      {
+        name:'连续包月',
+        price:'8',
+        currentPrice:'20',
+        description:'前两个月仅需8元,续费20元/月,可随时取消'
+      },
+      {
+        name:'3个月',
+        price:'40',
+        currentPrice:'160',
+        description:'40元购3个月会员,享尊贵特权'
+      },
+      {
+        name:'12个月',
+        price:'138',
+        currentPrice:'580',
+        description:'138元购12个月会员,享尊贵特权'
+      }
+    ],
+    chooseVip:null,
+    tableData:[
+      { functionName: '查看爆款产品', notVip: '23', vip: '20'},
+      { functionName: '查看产品相关专利', notVip: '23', vip: '20'},
+      { functionName: '专利导出', notVip: '23', vip: '20' }
+    ],//会员权益
+    tableHead:[
+      { key: 'functionName', name: '功能类型' },
+      { key: '456', name: '非会员' },
+      { key: '789', name: '会员' },
+    ]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.getUserinfo()
+    this.getVipRights()
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 页面功能
+   */
+   //获取会员权益
+   getVipRights(){
+    var that = this
+    api.getVipRights().then(res=>{
+      if(res.code == 200){
+        var data = res.data.data
+        var tableData = []
+        for(var i = 0;i<data.length;i++){
+          var obj = {
+            functionName:data[i].functionName
+          }
+          var right = data[i].vipRightsVOList
+          for(var j = 0;j<that.data.tableHead.length;j++){
+            var head = that.data.tableHead[j]
+            if(head.key == 'functionName'){
+              continue
+            }
+            var obj2 = right.find(item=>{
+              return item.vipUuid == head.key
+            })
+            if(obj2){
+              obj[head.key] = obj2.description
+            }else{
+              obj[head.key] = ''
+            }
+          }
+          tableData.push(obj)
+        }
+        that.setData(
+          {
+            tableData:tableData
+          }
+        )
+        console.log(that.data.tableHead,that.data.tableData)
+      }
+    })
+  },
+  //获取用户信息
+  getUserinfo(){
+    api.selectPerson().then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            userinfo:res.data
+          }
+        )
+      }
+    })
+  },
+  //选择会员类型
+  chooseVip(e){
+    var {item} = e.currentTarget.dataset
+    this.setData(
+      {
+        chooseVip:item
+      }
+    )
+  },
+  //开通会员
+  successPay(e){
+    this.getUserinfo()
+    var pages = getCurrentPages()
+    var currentPage = pages[pages.length - 2]
+    currentPage.getUserinfo()
+  },
+  openVip(){
+    if(!this.data.chooseVip){
+      api.notify(
+        {
+          type:'warning',
+          message:'请先选择需要开通会员的类型',
+          // top:wx.getStorageSync('height')
+        }
+      )
+      return
+    }
+    var data ={
+      title:'开通会员',
+      type:'-1',
+      goods:[
+        {
+          ...this.data.chooseVip,
+          num:1
+        }
+      ],
+      servicePrice:0.00,
+      price:this.data.chooseVip.price,
+      discount:'',
+    }
+    pay.openPay(data)
+    return 
+    if(!this.data.chooseVip){
+      api.notify(
+        {
+          type:'warning',
+          message:'请先选择需要开通会员的类型',
+          top:wx.getStorageSync('height')
+        }
+      )
+      return
+    }
+    var params = {
+      goodType:1,
+      goodUuid:this.data.choseVip.vipUuid
+    }
+    wx.showLoading({
+      title: '加载中',
+    })
+    pay.payMoney(params).then(res=>{
+      if(res.errMsg == 'requestPayment:ok'){
+        api.notify(
+          {
+            type:'success',
+            message:'开通会员成功',
+            top:wx.getStorageSync('height')
+          }
+        )
+        this.getUserinfo()
+        var pages = getCurrentPages()
+        var currentPage = pages[pages.length - 2]
+        currentPage.getUserinfo()
+      }
+    }).catch(error=>{
+
+    })
+  
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 6 - 0
pages/memberCenter/menberCenter2.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {
+    "wux-avatar":"/miniprogram_npm/wux-weapp/avatar/index",
+    "mytable":"/myComponents/table/table"
+  }
+}

+ 64 - 0
pages/memberCenter/menberCenter2.wxml

@@ -0,0 +1,64 @@
+<!--pages/memberCenter/menberCenter2.wxml-->
+<van-notify id="van-notify"></van-notify>
+<myPay id="myPay" bindsuccess="successPay"></myPay>
+<view class="memberCenter">
+  <!-- <view class="headTitle">会员中心</view> -->
+  <view class="content">
+    <!-- 个人信息 -->
+    <view class="userinfo">
+      <view class="left">
+        <wux-avatar size="large" wx:if="{{userinfo.fileGuid}}" src="{{imgHttp}}{{userinfo.fileGuid}}"></wux-avatar>
+        <wux-avatar size="large" wx:else src="/static/image/unlogin.jpeg"></wux-avatar>
+        <view class="message">
+          <view class="name">{{userinfo.name || userinfo.phoneNum}} 
+          <span wx:if="{{userinfo.vip.name}}" class="vipicon">vip</span>
+          </view>
+        </view>
+      </view>
+    </view>
+    <!-- 开通会员类型 -->
+    <scroll-view  scroll-x="true">
+      <view class="vipType">
+        <view  wx:for="{{vipType}}" class="vipType_item {{chooseVip.name == item.name?'checked':''}}" data-item="{{item}}" bind:tap="chooseVip">
+          <view class="vipType_item_title">{{item.name}}</view>
+          <view class="vipType_item_price"><span wx:if="{{item.price || item.price == 0}}" style="font-size: 12px;">¥</span>{{item.price}}</view>
+          <view class="vipType_item_currentPrice"><span wx:if="{{item.currentPrice || item.currentPrice == 0}}">¥</span>{{item.currentPrice}}</view>
+        </view>
+      </view>
+    </scroll-view>
+    <!-- 会员权益 -->
+    <view class="vipDescription">
+      <!-- <view>{{chooseVip.description}}</view> -->
+      <view class="vipDescription_title">赠送以下权益:</view>
+      <view class="vipDescription_content">
+        <view class="vipDescription_content_item">
+          <view class="vipDescription_content_item_img">
+            <image class="vipDescription_content_item_img" src="../../static/image/卡券.png" mode="aspectFit"/>
+          </view>
+          <view class="vipDescription_content_item_text">
+            <view>专属优惠券</view>
+            <view style="font-size: 20rpx;margin-top: 4px;">100元无门槛</view>
+          </view>
+        </view>
+        <view class="vipDescription_content_item">
+          <view class="vipDescription_content_item_img">
+            <image class="vipDescription_content_item_img" src="../../static/image/服务.png" mode="aspectFit"/>
+          </view>
+          <view class="vipDescription_content_item_text">深度功能解锁</view>
+        </view>
+      </view>
+    </view>
+    <!-- 开通会员按钮 -->
+    <view class="payBtn {{!chooseVip?'noPay':''}}" bind:tap="openVip">
+      <view wx:if="{{chooseVip.price || chooseVip.price == 0}}" class="payBtn_price">¥{{chooseVip.price}}</view>
+      <view>确认开通</view>
+    </view>
+    <!-- 会员权益 -->
+    <view class="equityDetails">
+      <view class="equityDetails_title">会员权益对比</view>
+      <view class="equityDetails_content">
+        <mytable thead="{{tableHead}}" data="{{tableData}}" tdStyle=" width:calc(100vw / 3);text-align:left ;white-space: normal;overflow-wrap: break-word;"></mytable>
+      </view>
+    </view>
+  </view>
+</view>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 144 - 0
pages/memberCenter/menberCenter2.wxss


+ 6 - 1
pages/mine/mine.js

@@ -41,6 +41,11 @@ Page({
       //   page:'/pages/myFollow/myFollow'
       // },
       {
+        type:6,
+        label:'我的优惠券',
+        page:'/pages/voucher/voucher?all=true'
+      },
+      {
         type:2,
         label:'检索记录',
         icon:'myIconguanzhu',
@@ -233,7 +238,7 @@ Page({
   //开通会员
   openVIP(){
     wx.navigateTo({
-      url: '/pages/memberCenter/memberCenter',
+      url: '/pages/memberCenter/menberCenter2',
     })
   },
 

+ 4 - 2
pages/mine/mine.wxml

@@ -12,8 +12,10 @@
       <wux-avatar size="large" wx:if="{{userinfo.fileGuid}}" src="{{imgHttp}}{{userinfo.fileGuid}}" bind:tap="editMessage"></wux-avatar>
       <wux-avatar size="large" wx:else src="/static/image/unlogin.jpeg" bind:tap="editMessage"></wux-avatar>
       <view class="message">
-        <view class="name">{{userinfo.name || userinfo.phoneNum}}</view>
-        <view class="type"> <text class="iconfont myIconrenyuan icon"></text> {{userinfo.vip.name|| '普通用户'}}</view>
+        <view class="name">{{userinfo.name || userinfo.phoneNum}}
+          <span wx:if="{{userinfo.vip.name}}" class="vipicon">vip</span>
+        </view>
+        <!-- <view class="type"> <text class="iconfont myIconrenyuan icon"></text> {{userinfo.vip.name|| '普通用户'}}</view> -->
       </view>
     </view>
     <view class="right" bind:tap="openVIP">

+ 12 - 0
pages/mine/mine.wxss

@@ -16,6 +16,18 @@
 .name{
   font-size: 35rpx;
   font-weight: bolder;
+  display: flex;
+  align-items: center;
+}
+.vipicon{
+  margin-left: 10px;
+  font-size: 28rpx;
+  font-weight: normal;
+  font-style: italic;
+  background-color: var(--themeColor);
+  color: white;
+  padding:0 5px 2px 5px;
+  border-radius: 5px;
 }
 .type{
   width: 170rpx;

+ 27 - 1
pages/myWork/myWork.js

@@ -227,8 +227,34 @@ Page({
     this[data.method](data.data,data.index)
   },
   //支付3
+  successPay(e){
+    var data = e.detail
+    var index = data.index
+    this.setData(
+      {
+        ["tableData["+index+"].ticketProgress"]:3
+      }
+    )
+  },
   payMoney(data,index){
-    console.log(data)
+    var payData ={
+      title:'支付工单',
+      type:data.ticketType,
+      index:index,
+      goods:[
+        {
+          id:data.id,
+          name:this.data.ticketTypes[data.ticketType]+'-工单',
+          price:data.price,
+          num:1
+        }
+      ],
+      servicePrice:0.00,
+      price:data.price,
+      discount:'',
+    }
+    pay.openPay(payData)
+    return
     var params = {
       goodType:2,
       goodUuid:data.num

+ 1 - 1
pages/myWork/myWork.wxml

@@ -2,7 +2,7 @@
 
 <navBar></navBar>
 <van-notify id="van-notify"/>
-
+<myPay id="myPay" bindsuccess="successPay"></myPay>
 <view class="myWork">
   <view class="head">
     <text>提交工单记录</text>

+ 24 - 0
pages/myWork/workDetail.js

@@ -108,7 +108,31 @@ Page({
     this[method](this.data.work)
   },
    //支付3
+   successPay(e){
+    this.setData(
+      {
+        ["work.ticketProgress"]:3
+      }
+    )
+  },
    payMoney(data){
+    var payData ={
+      title:'支付工单',
+      type:data.ticketType,
+      goods:[
+        {
+          id:data.id,
+          name:this.data.ticketTypes[data.ticketType]+'-工单',
+          price:data.price,
+          num:1
+        }
+      ],
+      servicePrice:0.00,
+      price:data.price,
+      discount:'',
+    }
+    pay.openPay(payData)
+    return
     var params = {
       goodType:2,
       goodUuid:data.num

+ 1 - 1
pages/myWork/workDetail.wxml

@@ -1,5 +1,5 @@
 <!--pages/myWork/workDetail.wxml-->
-
+<myPay id="myPay" bindsuccess="successPay"></myPay>
 <van-popup
   show="{{ show }}"
   closeable="{{true}}"

+ 290 - 0
pages/voucher/voucher.js

@@ -0,0 +1,290 @@
+// pages/voucher/voucher.js
+const api = require('../../api/index')
+const pay = require('../../utils/pay')
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    myVoucherList:[],
+  myVoucherTotal:0,
+  discount:0,
+  chooseVoucher:[],
+  useScopes:null,
+  totalPrice:0,
+  voucherList:[],
+  buyVoucher:[],
+  payMoney:0,
+  all:null
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    if(options.all){
+      this.setData(
+        {
+          all:options.all
+        }
+      )
+      this.queryPersonVoucher()
+    }
+    const eventChannel = this.getOpenerEventChannel()
+    var that = this
+    eventChannel.on('acceptDataFromPay', function(data) {
+      that.setData(
+        {
+          chooseVoucher:data.chooseVoucher,
+          useScopes:data.useScopes,
+          totalPrice:data.totalPrice
+        }
+      )
+      that.queryPersonVoucher(1)
+    })
+    //获取可购买的优惠券
+    this.queryVoucher()
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+  //获取可购买的优惠券
+  queryVoucher(){
+    api.queryVoucher().then(res=>{
+      if(res.code == 200){
+        this.setData(
+          {
+            voucherList:res.data.data
+          }
+        )
+      }
+    })
+  },
+  //查询个人优惠券
+  queryPersonVoucher(sign){
+    var params = {
+      useScopes:(this.data.useScopes == null || this.data.useScopes.length == 0)?null:[this.data.useScopes],
+    }
+    api.queryPersonVoucher(params).then(res=>{
+      if(res.code == 200){
+        var data = res.data.data
+        var data2 = data.filter(item=>{
+          if(item.threshold < Number(this.data.totalPrice)){
+            item.useScopesText = this.getUseScopeText(item.useScopes)
+          }
+          return item
+        })
+        this.setData(
+          {
+            myVoucherList:data2,
+            myVoucherTotal:data2.length
+          }
+        )
+        if(sign == 1 && this.data.chooseVoucher){
+          this.changeChooseVoucher(
+            {
+              detail:this.data.chooseVoucher
+            }
+          )
+        }
+      }
+    })
+  },
+  //显示使用范围
+  showUseScopes(e){
+    var {usescopes} = e.currentTarget.dataset
+    var useScopesText = this.getUseScopeText(usescopes)
+    wx.showModal({
+      title: '使用范围',
+      content: useScopesText,
+      showCancel:false,
+      confirmText:'我知道了',
+      complete: (res) => {
+        if (res.confirm) {
+          
+        }
+      }
+    })
+  },
+  //获取可使用范围的文本信息
+  getUseScopeText(useScopes){
+    if(!useScopes || useScopes.length == 0){
+      return ''
+    }
+    var obj = {
+      '-1':'开通会员',
+      '0':'购买券',
+      '1':'专利解读',
+      '2':'维权工单',
+      '3':'申诉工单',
+      '4':'申请工单',
+    }
+    var data = []
+    useScopes.forEach(item => {
+      var str = obj[item]
+      if(str){
+        data.push(str)
+      }
+    });
+    return data.join('、')
+  },
+  //修改选择需要使用的优惠券
+  changeChooseVoucher(e){
+    var data = e.detail
+    var arr = this.data.myVoucherList.filter(item=>{
+      return data.indexOf(item.id+'')!=-1
+    })
+    var discount = 0
+    arr.forEach(item=>{
+      if(item.type == 1){
+        discount = Number(this.data.totalPrice) * (1 - Number(item.amount))
+      }else{
+        discount += Number(item.amount)
+      }
+      
+    })
+    this.setData({
+      chooseVoucher: data,
+      discount:discount
+    });
+  },
+  //确认选择
+  submit(){
+    const eventChannel = this.getOpenerEventChannel()
+    eventChannel.emit('acceptDataFromVoucher', {chooseVoucher: this.data.chooseVoucher,discountPrice:this.data.discount});
+    wx.navigateBack()
+  },
+  //修改选择需要购买的优惠券
+  changeBuyVoucher(e){
+    var data = e.detail
+    var arr = this.data.voucherList.filter(item=>{
+      return data.indexOf(item.id+'')!=-1
+    })
+    var payMoney = 0
+    arr.forEach(item=>{
+      if(item.buyNumber){
+        payMoney += Number(item.sellingPrice) * Number(item.buyNumber)
+      }else{
+        payMoney += Number(item.sellingPrice)
+      }
+      
+    })
+    this.setData({
+      buyVoucher: data,
+      payMoney:payMoney
+    });
+  },
+  //修改数量
+  changeNumber(e){
+    var {index} = e.currentTarget.dataset
+    var value = e.detail
+    var item = this.data.voucherList[index]
+    if(this.data.buyVoucher.indexOf(item.id+'')!=-1){
+      var payMoney = this.data.payMoney
+      if(item.buyNumber){
+        if(item.buyNumber < value){
+          payMoney  =Number(payMoney) + Number(item.sellingPrice)
+        }else if(item.buyNumber > value){
+          payMoney  =Number(payMoney) - Number(item.sellingPrice)
+        }
+      }else{
+        payMoney = Number(payMoney) + Number(item.sellingPrice)
+      }
+      this.setData(
+        {
+          payMoney:payMoney
+        }
+      )
+    }
+    this.setData(
+      {
+        ["voucherList["+index+"].buyNumber"]:value
+      }
+    )
+  },
+  //支付
+  pay(){
+    if(!this.data.buyVoucher || this.data.buyVoucher.length == 0){
+      api.notify(
+        {
+          type:'warning',
+          message:'请先选择需要购买的券',
+          // top:wx.getStorageSync('height')
+        }
+      )
+      return
+    }
+    var goods = []
+    this.data.voucherList.forEach(item=>{
+      if(this.data.buyVoucher.indexOf(item.id+'')!=-1){
+        var obj = {
+          id:item.id,
+          name:item.name,
+          price:item.sellingPrice,
+          num:item.buyNumber || 1
+        }
+        goods.push(obj)
+      }
+    })
+    var data ={
+      title:'购买券',
+      type:'0',
+      goods:goods,
+      servicePrice:0.00,
+      price:this.data.payMoney,
+      discount:1,
+    }
+    pay.openPay(data)
+  },
+  //成功支付
+  successPay(e){
+    this.queryPersonVoucher()
+  },
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/voucher/voucher.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+    "van-checkbox": "/miniprogram_npm/@vant/weapp/checkbox/index",
+    "van-checkbox-group": "/miniprogram_npm/@vant/weapp/checkbox-group/index",
+    "van-stepper": "/miniprogram_npm/@vant/weapp/stepper/index"
+  }
+}

+ 80 - 0
pages/voucher/voucher.wxml

@@ -0,0 +1,80 @@
+<!--pages/voucher/voucher.wxml-->
+<myPay id="myPay" bindsuccess="successPay"></myPay>
+<view class="voucher {{all?'all':''}}" >
+  <!-- 购买优惠券 -->
+  <view class="buyVoucher shadow">
+    <view class="head">购买优惠券</view>
+    <view class="buyVoucher_content">
+      <scroll-view  scroll-x="true">
+        <view class="voucher_type">
+          <view class="voucher_item" wx:for="{{voucherList}}" wx:key="index">
+            <view class="voucher_item_content">
+              <view class="voucher_name">
+                {{item.name}}
+              </view>
+              <view class="voucher_amount">
+                {{item.amount}}<span style="font-size: 24rpx;">元</span> 
+              </view>
+              <view class="voucher_threshold">
+                {{item.threshold?'满'+item.threshold+'可用':'无门槛'}}
+              </view>
+              <view class="foot">
+                {{item.expirationTime?item.expirationTime+'到期':'永久'}} | 使用范围 <van-icon name="question-o" data-useScopes="{{item.useScopes}}" bind:tap="showUseScopes"/>
+              </view>
+            </view>
+            <view class="voucher_price">
+              <van-checkbox-group value="{{ buyVoucher }}" bind:change="changeBuyVoucher">
+                <van-checkbox label-class="voucher_price1" name="{{item.id}}">¥{{item.sellingPrice}}</van-checkbox>
+              </van-checkbox-group>
+              <van-stepper value="{{ item.buyNumber }}" data-index="{{index}}" bind:change="changeNumber" />
+            </view>
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+    <view class="pay">
+      <view class="payBtn" bind:tap="pay">支付 <span wx:if="{{payMoney}}">¥{{payMoney}}</span> </view>
+    </view>
+  </view>
+  <!-- 已拥有优惠券 -->
+  <view class="myVoucher shadow">
+    <view class="head">我的优惠券 <span style="font-size: 20rpx;color: darkgray;">{{myVoucherTotal}} 张</span></view>
+    <view class="myVoucher_content">
+      <block wx:if="{{myVoucherList.length>0}}">
+        <view class="myVoucher_item" wx:for="{{myVoucherList}}" wx:key="index">
+          <view class="myVoucher_item_top">
+            <view class="myVoucher_item_top_left">
+              <view class="myVoucher_name">{{item.name}}</view>
+              <view class="myVoucher_expirationTime">{{item.expirationTime?item.expirationTime+'到期':'永久'}}</view>
+            </view>
+            <view class="myVoucher_item_top_right">
+              <view style="margin-right: 10px;">
+                <view class="myVoucher_amount"> <span style="font-size: 28rpx;">¥</span>{{item.amount}}</view>
+                <view class="myVoucher_threshold">{{item.threshold?'满'+item.threshold+'可用':'无门槛'}}</view>
+              </view>
+              <view wx:if="{{!all}}">
+                <van-checkbox-group value="{{ chooseVoucher }}" bind:change="changeChooseVoucher">
+                  <van-checkbox label-class="voucher_price1" name="{{item.id}}"></van-checkbox>
+                </van-checkbox-group>
+              </view>
+            </view>
+          </view>
+          <view class="myVoucher_item_bottom">
+            使用范围:{{item.useScopesText}}
+          </view>
+        </view>
+      </block>
+      <view wx:else class="empty">
+        暂无数据
+      </view>
+    </view>
+  </view>
+ 
+</view>
+ <!-- 确认 -->
+ <view class="submit" wx:if="{{!all}}">
+    <view>红包优惠¥{{discount}}</view>
+    <view class="submit_btn" bind:tap="submit">
+      <view>确 认</view>
+    </view>
+  </view>

+ 195 - 0
pages/voucher/voucher.wxss

@@ -0,0 +1,195 @@
+/* pages/voucher/voucher.wxss */
+.voucher{
+  padding: 10px;
+  height: calc(100vh - 100px);
+  overflow-y: auto;
+}
+.all{
+  height: calc(100vh - 30px) !important;
+}
+.shadow{
+  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 6px 0px;
+  border-radius: 5px;
+}
+.buyVoucher{
+
+}
+.head{
+  width: fit-content;
+  padding: 5px 15px;
+  border-radius: 5px;
+  color: white;
+  font-size: 24rpx;
+  background: var(--themeColor)
+}
+.buyVoucher_content{
+  padding: 8px;
+}
+
+.voucher_type{
+  margin-top: 0px;
+  height: 170px;
+  width: 100%;
+  white-space: nowrap;
+  display: flex;
+}
+.voucher_item{
+  min-width: 200px;
+  max-width: 200px;
+  height: 120px;
+  margin-right: 20px;
+}
+.voucher_item_content{
+  /* background-color: rgb(255, 247, 245); */
+  background-color: #3754BA;
+  border-radius: 10px;
+}
+.voucher_name{
+  /* background-color: rgb(255, 212, 216); */
+  background-color: #FDF3DB;
+  width: 80%;
+  margin: 10px auto;
+  text-align: center;
+  border-radius: 0 0 10px 10px ;
+}
+.voucher_amount{
+  font-size: 45rpx;
+  /* color: red; */
+  color: white;
+  text-align: center;
+}
+.voucher_threshold{
+  font-size: 28rpx;
+  /* color: rgb(235, 117, 88); */
+  color: white;
+  text-align: center;
+}
+.foot{
+  font-size: 26rpx;
+  text-align: center;
+  /* color: white; */
+  color:black;
+  border-radius: 0 0 10px 10px;
+  /* background-color: rgb(252, 79, 117); */
+  background-color: #FDF3DB;
+  padding: 15px 5px 5px 5px  ;
+  position: relative;
+}
+.foot::before{
+  content: "";  
+  position: absolute;  
+  top: 0px; /* 伪元素定位在容器上方 */  
+  left:0px;  
+  width: 100%;  
+  height: 10px; /* 伪元素的高度,可以根据需要调整 */  
+  /* background-color: rgb(255, 247, 245); 和容器背景色相同   */
+  background-color: #3754BA;
+  border-radius:100% /  0 0 30px  30px; /* 这里是关键,设置边框半径来实现弧形效果 */ 
+}
+
+.voucher_price{
+  margin-top: 10px;
+  color:rgb(235, 117, 88) ;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.voucher_price1{
+  color:red !important;
+}
+.pay{
+  display: flex;
+  justify-content: flex-end;
+  padding: 0 10px 10px 0;
+}
+.payBtn{
+  background-color: var(--themeColor);
+  border-radius: 5px;
+  padding: 4px 12px;
+  width: fit-content;
+  color: white;
+  font-size: 30rpx;
+}
+
+.myVoucher{
+  margin-top: 20px;
+  min-height: 200px;
+}
+.myVoucher_content{
+  padding: 8px;
+}
+.myVoucher_item{
+  background-color: var(--themeColor);
+  padding: 8px;
+  border-radius: 10px;
+  color: white;
+  margin-bottom: 10px;
+}
+.myVoucher_item_top{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.myVoucher_item_top_right{
+  display: flex;
+  align-items: center;
+}
+.myVoucher_name{
+  font-size: 32rpx;
+}
+.myVoucher_expirationTime{
+  margin-top: 8px;
+  background-color: rgb(252, 236 , 230);
+  color: red;
+  padding: 4px;
+  font-size: 22rpx;
+  width: fit-content;
+  border-radius: 5px;
+}
+.myVoucher_amount{
+  font-size: 46rpx;
+  color:red;
+  /* color:rgb(230, 42, 42); */
+}
+.myVoucher_threshold{
+  color: rgb(255, 212, 216);
+  font-size: 24rpx;
+}
+.myVoucher_item_bottom{
+  margin-top: 10px;
+  padding: 10px 0;
+  border-top: darkgray dashed 1px;
+  color: darkgray;
+  font-size: 28rpx;
+}
+.submit{
+  position: fixed;
+  bottom: 10px;
+  margin: 10px;
+  font-size: 26rpx;
+  padding-left: 10px;
+  color: white;
+  background: rgb(49, 46, 46);
+  width: calc(100% - 30px);
+  height: 50px;
+  line-height: 50px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  border-radius: 50px ;
+}
+.submit_btn{
+  font-size: 30rpx;
+  height: 100%;
+  min-width: 70px;
+  text-align: center;
+  border-radius: 0 50px 50px 0;
+  padding:0 10px;
+  background-color: var(--themeColor);
+}
+
+.empty{
+  text-align: center;
+  line-height: 150px;
+  color: darkgray;
+}

BIN
static/image/350.png


BIN
static/image/卡券.png


BIN
static/image/服务.png


+ 14 - 3
utils/pay.js

@@ -35,7 +35,11 @@ function payMoney(data){
                 },
                 "fail":function(res){
                   var obj = getPages()
-                  obj.message = '支付失败'
+                  if(res.errMsg == 'requestPayment:fail cancel'){
+                    obj.message = '取消支付'
+                  }else{
+                    obj.message = '支付失败'
+                  }
                   if(obj.message){
                     Notify(obj)
                   }
@@ -43,7 +47,7 @@ function payMoney(data){
                   // resolve(res); 
                 },
                 "complete":function(res){
-                  console.log(res)
+                  // console.log(res)
                   resolve(res); 
                 }
               }
@@ -55,7 +59,14 @@ function payMoney(data){
   })
 }
 
+function open(data,selector='myPay'){
+  var pages = getCurrentPages()
+  const actionSheetRef = pages[pages.length-1].selectComponent('#'+selector)
+  actionSheetRef.show(data)
+}
+
 // 导出请求方法  
 module.exports = {  
-  payMoney: (data) => payMoney(data)
+  payMoney: (data) => payMoney(data),
+  openPay: (data,selector) => open(data,selector)
 };

+ 2 - 2
utils/request.js

@@ -5,7 +5,7 @@ import Notify from '../miniprogram_npm/@vant/weapp/notify/notify';
 const config = {  
   // baseURL: 'http://192.168.1.18:8901', // 基础URL  
   baseURL: 'https://www.xsip.cn', // 基础URL  
-  timeout: 30000, // 超时时间(单位ms)  
+  timeout: 300000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
     // 其他全局请求头...  
@@ -14,7 +14,7 @@ const config = {
   tabbar:["pages/index/index","pages/hotProduct/hotProduct","pages/mine/mine"]
 };  
 const apiUrl = {  
-  develop: 'https://www.xsip.cn', // 开发环境地址  
+  develop: 'http://192.168.2.120:8902', // 开发环境地址  
   trial: 'https://www.xsip.cn/test', // 测试环境地址  
   release: 'https://www.xsip.cn' // 生产环境地址  
 };

+ 2 - 2
utils/upload.js

@@ -4,7 +4,7 @@ const token = wx.getStorageSync('token')
 const config = {  
   // baseURL: 'http://192.168.1.6:8802', // 基础URL 
   baseURL: 'https://www.xsip.cn', // 基础URL   
-  timeout: 30000, // 超时时间(单位ms)  
+  timeout: 300000, // 超时时间(单位ms)  
   header: {  
     'content-type': 'application/json', // 默认请求头  
     // 其他全局请求头... 
@@ -14,7 +14,7 @@ const config = {
   tabbar:["pages/index/index","pages/hotProduct/hotProduct","pages/mine/mine"] 
 };  
 const apiUrl = {  
-  develop: 'https://www.xsip.cn', // 开发环境地址  
+  develop: 'http://192.168.2.120:8802', // 开发环境地址  
   trial: 'https://www.xsip.cn', // 测试环境地址  
   release: 'https://www.xsip.cn' // 生产环境地址  
 };