diff --git a/project.config.json b/project.config.json index efb6c18..26c3eae 100644 --- a/project.config.json +++ b/project.config.json @@ -29,13 +29,13 @@ "list": [] }, "miniprogram": { - "current": 1, + "current": 0, "list": [ { "id": 0, "name": "product_page", "pathName": "pages/product", - "query": "gid=7002058&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVjNmUxYjk3NDA5MGY5NTYxM2M3YjgxOSIsImFjY291bnRfaWQiOiI2MDAxXzgwMDNfb0pZYXA1WlZSV0RGRm9Qd09GcGllQmVNRkVocyIsInNlc3Npb25faWQiOiIxNTUwNzU0Njg5XzE1NTA3MTc1OTRfYjA5YTVmOWYxODM0NDFmOWUxMDk1MGJmOTUyZTRjMjFfNTcyOWRkOWYyMzQ5NzdlM2IwMGNjOGFjYWRjMjFiOTQiLCJpYXQiOjE1NTA3NTQ2ODl9.GkUGGb2vwTE1xgZ-UKwl6Tfs3NFawE2V3ZAH91_syY4", + "query": "gid=7002058&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVjN2Y1NWIyYzQ0NzVmMWMzMDg4YjcxOSIsImFjY291bnRfaWQiOiI2MDAxXzgwMDRfbzVGclg1WG45eHM4d1pmdHlSYVd4ZEVuQ2FyMCIsInNlc3Npb25faWQiOiIxNTUxODQ4ODgxXzE1NTE4NDg0NjVfNmFhZjNlMTQzNWMxNDNiODdkYzI0MWU2ZTQ0MGYwMmFfNjgxYzhiYWUxZGI0ODFiMDdkYmQxNzJjYmMwNDVlYWQiLCJpYXQiOjE1NTE4NDg4ODJ9.kdTs8UIGP9sxdZN7cpO047bBg69SBUQn6BMZ0Ndckgg", "scene": null }, { diff --git a/src/jcfw/SDKManage.js b/src/jcfw/SDKManage.js index a888e1c..20e786c 100755 --- a/src/jcfw/SDKManage.js +++ b/src/jcfw/SDKManage.js @@ -1,20 +1,7 @@ var jcfw = require('./jcfw'); var jcgamelog = jcfw.gamelog; var jcshare = jcfw.share; -var ShareConfig = { - 'money': - { - urls: ['gift.jpg'], - titles: ['领元宝'], - logid: 1 - }, - 'normal': - { - urls: ['gift.jpg'], - titles: ['领元宝'], - logid: 2 - } -}; + var SDKManage = function() { this.isoffical = false; this.gameId = 8003; @@ -101,13 +88,7 @@ var SDKManage = function() { var self = this; var cbs = function(res) { self.doLogin(); - for (var i = 0; i < res.length; i++) { - var sdt = res[i]; - if (ShareConfig[sdt.type]) { - ShareConfig[sdt.type].urls = sdt.images; - ShareConfig[sdt.type].titles = sdt.strs; - } - } + // if(cc.sys.platform == cc.sys.WECHAT_GAME){ // wx.showShareMenu({ // withShareTicket: false diff --git a/src/mixins/cfg.js b/src/mixins/cfg.js new file mode 100644 index 0000000..f033027 --- /dev/null +++ b/src/mixins/cfg.js @@ -0,0 +1,17 @@ +import wepy from 'wepy' + +export default class cfgMixin extends wepy.mixin { + $getPrice(name) { + let cfgObj = wepy.getStorageSync('cfg'); + let price = cfgObj.ext_json_cfg; + let obj = {"product_price": 50, "vip_price": 5000, "vip_discount": 3000, "month_price": 1500, "month_discount": 1000}; + if (price) { + try { + obj = JSON.parse(price); + } catch (err) { + console.log('parse json error'); + } + } + return obj[name]; + } +} diff --git a/src/pages/buyvip.wpy b/src/pages/buyvip.wpy index 20f8918..e188a66 100644 --- a/src/pages/buyvip.wpy +++ b/src/pages/buyvip.wpy @@ -17,15 +17,24 @@ border-right: 1rpx solid #e5e5e5; height: 100%; position:relative; + display: flex; } .price-txt { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); + width: 50%; + display: flex; + justify-content: center; + align-items: center; + font-size: 15px; } .product-name { width: 30%; + font-size: 15px; + } + .delete-txt{ + text-decoration: line-through; + } + .red-txt { + color: #ee3333; } .selected { border: 4rpx solid #f85; @@ -39,11 +48,17 @@ - 30元 + + 原价{{vip_price/100}}元 + 折扣价{{vip_discount/100}}元 + 终身 - 10元 + + 原价{{month_price/100}}元 + 折扣价{{month_discount/100}}元 + 一个月 @@ -56,8 +71,10 @@ import http from '../utils/http'; import jcEvent from '../common/jc-event'; import gameBottomBar from '../components/game-bottom-bar'; + import cfg from '../mixins/cfg'; export default class BuyVipPage extends wepy.page { + mixins = [cfg]; config = { navigationBarTitleText: '购买VIP' }; @@ -74,7 +91,12 @@ secondBtnTitle: '取消' }, tid: '', - currentType: 'vip' + currentType: 'vip', + vip_price: 5000, + vip_discount: 3000, + month_price: 1500, + month_discount: 1000 + }; methods = { selectType(type) { @@ -100,6 +122,13 @@ onLoad(params) { this.gid = decodeURIComponent(params.gid); } + onShow() { + this.vip_price = this.$getPrice('vip_price'); + this.vip_discount = this.$getPrice('vip_discount'); + this.month_price = this.$getPrice('month_price'); + this.month_discount = this.$getPrice('month_discount'); + this.$apply(); + } buy(type) { let self = this; let account = wepy.getStorageSync('account'); diff --git a/src/pages/product.wpy b/src/pages/product.wpy index 654f7b0..2d846b5 100644 --- a/src/pages/product.wpy +++ b/src/pages/product.wpy @@ -17,8 +17,10 @@ import addressFrom from '../components/address-form'; import http from '../utils/http'; import jcEvent from '../common/jc-event'; + import cfg from '../mixins/cfg'; export default class ProductPage extends wepy.page { + mixins = [cfg]; components = { gameBottomBar: gameBottomBar, addressFrom: addressFrom @@ -48,7 +50,8 @@ methods = { bottomMainTap(e) { console.log('bottomMainTap'); - this.showBuyMenu(); + // this.showBuyMenu(); + this.buy(); }, bottomSecondTap(e) { console.log('bottomSecondTap'); @@ -66,7 +69,7 @@ await this.updateUserInfo(); this.buy(); } catch (err) { - + console.log(err); } },