瀏覽代碼

开发购买记录页面

bayi 1 年之前
父節點
當前提交
7b947635ac

+ 2 - 0
api/global.js

@@ -4,6 +4,8 @@ import {
 module.exports = {
     //获取商品信息
     getProducts: data => request('/v3/product/learn', 'get', data),
+    // 获取订单记录
+    getOrderRecord: data => request('/order/helpList', 'get', data, true),
     // 领取代金卷
     getVoucher: data => request('/v3/activity/voucher', 'post', data),
     // 获取轮播图列表

+ 2 - 1
app.json

@@ -26,7 +26,8 @@
         "pages/invite/index",
         "pages/inviteRanking/index",
         "pages/aiAvatar/index",
-        "pages/searchFriend/index"
+        "pages/searchFriend/index",
+        "pages/orderRecord/index"
     ],
     "tabBar": {
         "custom": true,

+ 0 - 2
components/privacyPopup/index.js

@@ -1,6 +1,5 @@
 Component({
     properties: {
-
     },
     /**
      * 组件的初始数据
@@ -14,7 +13,6 @@ Component({
             if (wx.getPrivacySetting) {
                 wx.getPrivacySetting({
                     success: res => {
-                        console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
                         if (res.needAuthorization) {
                             this.setData({
                                 state: true

+ 1 - 1
pages/my/index.wxml

@@ -97,7 +97,7 @@
         </view>
         <image class='black' src='/static/black.png'></image>
     </view>
-    <view class="activation" bindtap="toGzh">
+    <view class="activation" bindtap="jump" data-url="/pages/orderRecord/index">
         <view class="tips">
             <image src="/static/care.png" class="tipsImg" />购买记录
         </view>

+ 12 - 0
pages/orderRecord/index.js

@@ -0,0 +1,12 @@
+import {
+    getOrderRecord
+} from '~/api/global'
+Page({
+    data: {
+        orderList: []
+    },
+    async onLoad(options) {
+        let res = await getOrderRecord()
+        console.log(res);
+    },
+})

+ 5 - 0
pages/orderRecord/index.json

@@ -0,0 +1,5 @@
+{
+    "usingComponents": {
+        "emptyBg": "/components/empty/index"
+    }
+}

+ 3 - 0
pages/orderRecord/index.less

@@ -0,0 +1,3 @@
+.empty{
+    margin-top: 200rpx;
+}

+ 3 - 0
pages/orderRecord/index.wxml

@@ -0,0 +1,3 @@
+<view>
+    <emptyBg class="empty" wx:if="{{orderList.length==0}}" message='还没有开通过vip哦'></emptyBg>
+</view>

+ 3 - 0
pages/orderRecord/index.wxss

@@ -0,0 +1,3 @@
+.empty {
+  margin-top: 200rpx;
+}

+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-/* if (envVersion == 'develop') {
+if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else { */
+} else {
     baseUrl = 'https://reader-api.ai160.com/wx'
     oldUrl = 'https://reader-api.ai160.com'
-// }
+}
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {