347617796@qq.com 3 년 전
부모
커밋
b22d7d7761
7개의 변경된 파일52개의 추가작업 그리고 20개의 파일을 삭제
  1. 2 3
      app.js
  2. 11 0
      pages/deploy/buy/buy.acss
  3. 5 1
      pages/deploy/buy/buy.axml
  4. 14 8
      pages/deploy/buy/buy.js
  5. 4 7
      pages/deploy/index/index.axml
  6. 15 1
      pages/deploy/index/index.js
  7. 1 0
      pages/deploy/sku/sku.axml

+ 2 - 3
app.js

@@ -1,8 +1,8 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 
-const baseUrl = "https://test-ding.g107.com/";//测试
-// const baseUrl = "https://ding.insys.g107.com/";//正式
+// const baseUrl = "https://test-ding.g107.com/";//测试
+const baseUrl = "https://ding.insys.g107.com/";//正式
 var that;
 var yearArr = [];
 var year = formatTime(new Date()).year;
@@ -332,7 +332,6 @@ App({
     that.getTypes(function () { });
     that.getCorp(options.query.corpId);
     that.globalData.corpId = options.query.corpId;
-    console.log(dd.canIUse('setTabBarBadge'))
     
     // dd.setTabBarBadge({
     //   index: 0,

+ 11 - 0
pages/deploy/buy/buy.acss

@@ -19,4 +19,15 @@
   height: 88rpx;
   text-align: center;
   line-height: 88rpx;
+}
+.icon{
+  width: 24rpx;
+  height: 24rpx;
+  margin-right: 28rpx;
+}
+.msg{
+  background: #FFF5CE;
+  color: #FFB441;
+  padding:4rpx 0;
+  font-size: 30rpx;
 }

+ 5 - 1
pages/deploy/buy/buy.axml

@@ -1,5 +1,9 @@
 <view style="line-height: 0rpx;">
-  <image mode="scaleToFill" src="{{item}}" class="vip" mode='widthFix' a:for="{{imgs}}"/>
+  <view class="flex-box-ce flex-center-center msg" a:if="{{vipData.status==2}}">
+    <image mode="scaleToFill" class="icon" src="../../../image/xf.png"/>
+    <text>{{vipData.msg}}</text>     
+  </view>
+  <image mode="scaleToFill" src="{{item}}" class="vip" mode='widthFix' a:for="{{vipData.banner}}"/>
   <view style="height:100rpx"></view>
   <view class="footer" onTap="openUrl">
     <view>成为尊享会员</view>

+ 14 - 8
pages/deploy/buy/buy.js

@@ -4,23 +4,29 @@ import 'dingtalk-jsapi/entry/mobile';
 import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
 Page({
   data: {
-    imgs:[
-      'https://img.zcool.cn/community/0109d161691b1311013f22cf803ae0.jpg@1280w_1l_2o_100sh.jpg',
-      'https://img.zcool.cn/community/0109d161691b1311013f22cf803ae0.jpg@1280w_1l_2o_100sh.jpg',
-      'https://img.zcool.cn/community/0109d161691b1311013f22cf803ae0.jpg@1280w_1l_2o_100sh.jpg'
-    ]
+    vipData:{}
   },
-  onLoad() {
+  onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "vip" });
     dd.setStorage({
       key: 'isShowNew',
       data: true,
     });
+    if(e.code){
+        this.getDetail(e.code)
+     }
+  },
+  getDetail(code){
+    app.$get("api/order/goods/info", {goods_code:code}).then((res) => {
+        this.setData({
+          vipData:res.data.data,
+        })
+    })
   },
   //跳转
-  openView(e) {
-    app.$get("api/order/goods/sku", { callback: "pages/deploy/sku/sku", goods_code: 'DT_GOODS_881634105565156' }).then((res) => {
+  openUrl() {
+    app.$get("api/order/goods/sku", { callback: "pages/deploy/sku/sku", goods_code: this.data.vipData.goods_code }).then((res) => {
       openLink({
           url: res.data.data.url
       })

+ 4 - 7
pages/deploy/index/index.axml

@@ -21,14 +21,11 @@
           <view class="xusj" data-index="1" onTap="openView">续费升级</view>
         </view>
       </view>
-      <view class="vip margin-bottom">
+      <view class="vip margin-bottom" a:if="{{vipData}}">
         <image mode="scaleToFill" src="../../../image/vip.png"></image>
-        <view class="btn" data-index="7" onTap="openView">{{vipText}}</view>
+        <view class="btn"  onTap="openView2">{{vipText}}</view>
       </view>
 
-
-
-
       <!-- <view class="flex-box flex-v-ce li " data-index="2" onTap="openView">
         <image class="img-left" mode="scaleToFill" src="../../../image/bmyg.png"></image>
         <view class="flex-box flex-v-ce flex-1 li-right">
@@ -50,13 +47,13 @@
           <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
         </view>
       </view> -->
-      <view class="flex-box flex-v-ce li" data-index="7" onTap="openView">
+      <!-- <view class="flex-box flex-v-ce li" data-index="7" onTap="openView">
         <image class="img-left" mode="scaleToFill" src="../../../image/bmyg.png"></image>
         <view class="flex-box flex-v-ce flex-1 li-right">
           <view class="title flex-1">上面落地服务 <text class="new" a:if="{{isShowNew}}">new</text></view>
           <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
         </view>
-      </view>
+      </view> -->
 
       <view class="flex-box flex-v-ce li" data-index="5" onTap="openView">
         <image class="img-left" mode="scaleToFill" src="../../../image/sj.png"></image>

+ 15 - 1
pages/deploy/index/index.js

@@ -8,17 +8,31 @@ Page({
     corpMessage:{},
     vipText:'立即开通',
     isShowNew:true,
+    vipData:'',
   },
   onLoad(query) {
     that = this;
     dd.setNavigationBar({ title: "我的" });
     this.setData({userData:app.globalData.userData,corpMessage:app.globalData.corpMessage});
+    this.getVip();
+  },
+  getVip(){
+    app.$get("api/order/goods/special").then((res) => {
+        this.setData({
+          vipData:res.data.data,
+          vipText:res.data.data.status==2?'已开通':'立即开通'
+        })
+    })
+  },
+  openView2(){
+    dd.navigateTo({
+      url: '../buy/buy?code=' + this.data.vipData.goods_code
+    })
   },
   onShow(){
     dd.getStorage({
       key: 'isShowNew',
       success: function (res) {
-        console.log(res)
         if(res.data){
           that.setData({isShowNew:false});
         }

+ 1 - 0
pages/deploy/sku/sku.axml

@@ -2,4 +2,5 @@
   <view>
     购买成功
   </view>
+  <button type="primary" onTap="">回到首页</button>
 </view>