From f9d8b5f910c06516af2483111d64f3ecd3f3cd4f Mon Sep 17 00:00:00 2001 From: devil Date: Mon, 6 Jan 2020 01:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BC=9A=E5=91=98VI?= =?UTF-8?q?P=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Plugins.php | 2 +- .../admin/view/default/plugins/index.html | 21 +++ application/api/controller/Goods.php | 25 +-- application/service/ResourcesService.php | 37 +++++ application/tags.php | 97 +++++++++++ .../appmini/old/alipay/pages/index/index.axml | 1 - .../appmini/old/alipay/pages/user/user.axml | 1 - .../appmini/old/baidu/pages/index/index.swan | 1 - public/appmini/old/baidu/pages/user/user.swan | 1 - public/appmini/old/qq/pages/index/index.qml | 1 - .../old/toutiao/pages/index/index.ttml | 1 - .../appmini/old/toutiao/pages/user/user.ttml | 1 - public/appmini/old/weixin/app.js | 4 +- public/appmini/old/weixin/app.json | 5 +- .../appmini/old/weixin/pages/index/index.wxml | 1 - .../pages/membervip-buy/membervip-buy.js | 152 ++++++++++++++++++ .../pages/membervip-buy/membervip-buy.json | 5 + .../pages/membervip-buy/membervip-buy.wxml | 45 ++++++ .../pages/membervip-buy/membervip-buy.wxss | 67 ++++++++ .../old/weixin/pages/membervip/membervip.js | 86 ++++++++++ .../old/weixin/pages/membervip/membervip.json | 5 + .../old/weixin/pages/membervip/membervip.wxml | 36 +++++ .../old/weixin/pages/membervip/membervip.wxss | 71 ++++++++ .../pages/user-membervip/user-membervip.js | 128 +++++++++++++++ .../pages/user-membervip/user-membervip.json | 5 + .../pages/user-membervip/user-membervip.wxml | 51 ++++++ .../pages/user-membervip/user-membervip.wxss | 82 ++++++++++ .../appmini/old/weixin/pages/user/user.json | 2 + .../appmini/old/weixin/pages/user/user.wxml | 1 - 29 files changed, 900 insertions(+), 35 deletions(-) create mode 100644 application/admin/view/default/plugins/index.html create mode 100644 public/appmini/old/weixin/pages/membervip-buy/membervip-buy.js create mode 100644 public/appmini/old/weixin/pages/membervip-buy/membervip-buy.json create mode 100644 public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxml create mode 100644 public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxss create mode 100644 public/appmini/old/weixin/pages/membervip/membervip.js create mode 100644 public/appmini/old/weixin/pages/membervip/membervip.json create mode 100644 public/appmini/old/weixin/pages/membervip/membervip.wxml create mode 100644 public/appmini/old/weixin/pages/membervip/membervip.wxss create mode 100644 public/appmini/old/weixin/pages/user-membervip/user-membervip.js create mode 100644 public/appmini/old/weixin/pages/user-membervip/user-membervip.json create mode 100644 public/appmini/old/weixin/pages/user-membervip/user-membervip.wxml create mode 100644 public/appmini/old/weixin/pages/user-membervip/user-membervip.wxss diff --git a/application/admin/controller/Plugins.php b/application/admin/controller/Plugins.php index 43b0e089a..7430d7602 100755 --- a/application/admin/controller/Plugins.php +++ b/application/admin/controller/Plugins.php @@ -106,7 +106,7 @@ class Plugins extends Common return $ret; } else { $this->assign('msg', $ret['msg']); - return $this->fetch('public/tips_error'); + return $this->fetch(); } } diff --git a/application/admin/view/default/plugins/index.html b/application/admin/view/default/plugins/index.html new file mode 100644 index 000000000..851d496b8 --- /dev/null +++ b/application/admin/view/default/plugins/index.html @@ -0,0 +1,21 @@ +{{include file="public/header" /}} + + +
+
+
+
+ + {{if empty($msg)}}没有相关数据{{else /}}{{$msg}}{{/if}} +
+ +
+
+
+ + + +{{include file="public/footer" /}} + \ No newline at end of file diff --git a/application/api/controller/Goods.php b/application/api/controller/Goods.php index e40e4b1cc..2f9495b99 100755 --- a/application/api/controller/Goods.php +++ b/application/api/controller/Goods.php @@ -14,6 +14,7 @@ use app\service\GoodsService; use app\service\BuyService; use app\service\PluginsService; use app\service\GoodsCommentsService; +use app\service\ResourcesService; /** * 商品 @@ -79,29 +80,7 @@ class Goods extends Common unset($ret['data'][0]['content_web']); } else { // 标签处理,兼容小程序rich-text - $search = [ - '', - '

', - '

', - '

', - '', + '

', + '

', + '

', + '
\ No newline at end of file diff --git a/application/tags.php b/application/tags.php index 7fb4b4ce8..adc212456 100755 --- a/application/tags.php +++ b/application/tags.php @@ -32,5 +32,102 @@ return array ( 'log_write' => array ( ), + 'plugins_css' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_navigation_header_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_goods_handle_end' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_base' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_buy_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_user_login_success_record' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_extends_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_admin_user_save' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_user_save_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_save_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_goods_detail_panel_price_top' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_home_goods_inside_bottom' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_search_goods_inside_bottom' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_type' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_users_center_left_menu_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_header_navigation_top_right_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_js' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_view_goods_detail_panel_bottom' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_view_buy_goods_bottom' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_view_buy_form_inside' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_buy_order_insert_success' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_order_status_change_history_success_handle' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_service_user_register_end' => + array ( + 0 => 'app\\plugins\\coupon\\Hook', + ), ); ?> \ No newline at end of file diff --git a/public/appmini/old/alipay/pages/index/index.axml b/public/appmini/old/alipay/pages/index/index.axml index 69ae712ad..cc100d612 100644 --- a/public/appmini/old/alipay/pages/index/index.axml +++ b/public/appmini/old/alipay/pages/index/index.axml @@ -81,7 +81,6 @@ - diff --git a/public/appmini/old/alipay/pages/user/user.axml b/public/appmini/old/alipay/pages/user/user.axml index e9fde2db1..bf7842e5a 100644 --- a/public/appmini/old/alipay/pages/user/user.axml +++ b/public/appmini/old/alipay/pages/user/user.axml @@ -76,6 +76,5 @@ - diff --git a/public/appmini/old/baidu/pages/index/index.swan b/public/appmini/old/baidu/pages/index/index.swan index 1e58ce794..c220e8897 100755 --- a/public/appmini/old/baidu/pages/index/index.swan +++ b/public/appmini/old/baidu/pages/index/index.swan @@ -81,7 +81,6 @@ - diff --git a/public/appmini/old/baidu/pages/user/user.swan b/public/appmini/old/baidu/pages/user/user.swan index a2779e329..4bdef1aa8 100755 --- a/public/appmini/old/baidu/pages/user/user.swan +++ b/public/appmini/old/baidu/pages/user/user.swan @@ -79,6 +79,5 @@ - diff --git a/public/appmini/old/qq/pages/index/index.qml b/public/appmini/old/qq/pages/index/index.qml index 213d29f23..8e1ed3eed 100755 --- a/public/appmini/old/qq/pages/index/index.qml +++ b/public/appmini/old/qq/pages/index/index.qml @@ -81,7 +81,6 @@ - diff --git a/public/appmini/old/toutiao/pages/index/index.ttml b/public/appmini/old/toutiao/pages/index/index.ttml index 0e8c0315a..97192c3c2 100755 --- a/public/appmini/old/toutiao/pages/index/index.ttml +++ b/public/appmini/old/toutiao/pages/index/index.ttml @@ -78,7 +78,6 @@ - diff --git a/public/appmini/old/toutiao/pages/user/user.ttml b/public/appmini/old/toutiao/pages/user/user.ttml index f214b1ae2..d68401ebc 100755 --- a/public/appmini/old/toutiao/pages/user/user.ttml +++ b/public/appmini/old/toutiao/pages/user/user.ttml @@ -75,6 +75,5 @@ - diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index ba05bbdd9..8f7e6da7f 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -63,11 +63,13 @@ App({ "coupon": "领劵中心", "user_coupon": "优惠劵", "extraction_address": "自提地址", + "membervip": "会员VIP", + "membervip_buy": "开通时长", }, // 请求地址 request_url: "{{request_url}}", - // request_url: 'http://shopxo.com/', + request_url: 'http://shopxo.com/', // request_url: 'https://dev.shopxo.net/', // 基础信息 diff --git a/public/appmini/old/weixin/app.json b/public/appmini/old/weixin/app.json index c887d4c67..cb59c6222 100755 --- a/public/appmini/old/weixin/app.json +++ b/public/appmini/old/weixin/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/user-membervip/user-membervip", "pages/index/index", "pages/goods-category/goods-category", "pages/cart/cart", @@ -28,7 +29,9 @@ "pages/user-orderaftersale-detail/user-orderaftersale-detail", "pages/coupon/coupon", "pages/user-coupon/user-coupon", - "pages/extraction-address/extraction-address" + "pages/extraction-address/extraction-address", + "pages/membervip/membervip", + "pages/membervip-buy/membervip-buy" ], "window": { "navigationBarTitleText": "{{application_title}}", diff --git a/public/appmini/old/weixin/pages/index/index.wxml b/public/appmini/old/weixin/pages/index/index.wxml index fd3579b57..521595019 100755 --- a/public/appmini/old/weixin/pages/index/index.wxml +++ b/public/appmini/old/weixin/pages/index/index.wxml @@ -81,7 +81,6 @@ - diff --git a/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.js b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.js new file mode 100644 index 000000000..66f888624 --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.js @@ -0,0 +1,152 @@ +const app = getApp(); +Page({ + data: { + data_bottom_line_status: false, + data_list_loding_status: 1, + data_list_loding_msg: '', + data_list: [], + data_base: null, + + selected_tabs_index: 0, + selected_content_index: null, + submit_disabled_status: false, + }, + + onLoad(params) { + this.init(); + }, + + onShow() { + wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip_buy }); + }, + + init() { + // 获取数据 + this.get_data_list(); + }, + + // 获取数据 + get_data_list() { + var self = this; + wx.showLoading({ title: "加载中..." }); + if (self.data.data_list.length <= 0) { + self.setData({ + data_list_loding_status: 1 + }); + } + + wx.request({ + url: app.get_request_url("index", "buy", "membershiplevelvip"), + method: "POST", + data: {}, + dataType: "json", + success: res => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + if (res.data.code == 0) { + var data = res.data.data; + var status = ((data.data || []).length > 0); + self.setData({ + data_base: data.base || null, + data_list: data.data || [], + data_list_loding_msg: '', + data_list_loding_status: status ? 3 : 0, + data_bottom_line_status: status, + }); + } else { + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: res.data.msg, + }); + if (app.is_login_check(res.data, self, 'get_data_list')) { + app.showToast(res.data.msg); + } + } + }, + fail: () => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: '服务器请求出错', + }); + app.showToast("服务器请求出错"); + } + }); + }, + + // 下拉刷新 + onPullDownRefresh() { + this.get_data_list(); + }, + + // tabs事件 + tabs_event(e) { + this.setData({ + selected_tabs_index: e.currentTarget.dataset.index || 0, + selected_content_index: null, + }); + }, + + // 时长事件 + content_event(e) { + this.setData({ + selected_content_index: e.currentTarget.dataset.index || 0, + }); + }, + + // 确认支付事件 + submit_event(e) { + if (this.data.selected_tabs_index < 0 || this.data.selected_content_index === null) + { + app.showToast('请选择开通时长'); + return false; + } + + // 请求参数 + var item = this.data.data_list[this.data.selected_tabs_index] || null; + if(item == null) + { + app.showToast('开通时长有误'); + return false; + } + var rules = ((item['pay_period_rules'] || null) == null) ? null : item['pay_period_rules'][this.data.selected_content_index] || null; + if (rules == null) { + app.showToast('开通时长有误'); + return false; + } + + // 请求生成支付订单 + var self = this; + wx.showLoading({ title: "处理中..." }); + wx.request({ + url: app.get_request_url("create", "buy", "membershiplevelvip"), + method: "POST", + data: { "opening": item['id'] + '-' + rules['number']}, + dataType: "json", + header: { 'content-type': 'application/x-www-form-urlencoded' }, + success: res => { + wx.hideLoading(); + self.setData({ submit_disabled_status: false }); + if (res.data.code == 0) { + // 进入以后会员中心并发起支付 + wx.redirectTo({ + url: '/pages/user-membervip/user-membervip', + }); + } else { + if (app.is_login_check(res.data, self, 'submit_event')) { + app.showToast(res.data.msg); + } + } + }, + fail: () => { + self.setData({ submit_disabled_status: false }); + wx.hideLoading(); + app.showToast("服务器请求出错"); + } + }); + }, + +}); \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.json b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.json new file mode 100644 index 000000000..d7bf94c8d --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.json @@ -0,0 +1,5 @@ +{ + "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#1d1611", + "backgroundColor": "#1d1611" +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxml b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxml new file mode 100644 index 000000000..4e60fe9e9 --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxml @@ -0,0 +1,45 @@ + + + + + {{item.name}} + + + + + + + + + + + + 终身 + {{rules.value}} + {{rules.unit}} + + + ¥ + {{rules.price}} + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxss b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxss new file mode 100644 index 000000000..1e12dad26 --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip-buy/membervip-buy.wxss @@ -0,0 +1,67 @@ +/** + * common + */ +.page { + padding-bottom: 100rpx; +} +/** + * tabs + */ +.tabs { + width: 100%; + height: 80rpx; + white-space: nowrap; + box-sizing: border-box; +} +.tabs .item { + padding: 20rpx 30rpx; + border-bottom: 3px solid #f0f0f0; + display: inline-block; + position: relative; +} +.tabs .active { + border-bottom: 3px solid #1d1611; + color: #1d1611; +} + +/** + * content + */ +.content .item { + cursor: pointer; + border: 1px solid #D6D6D6; + margin: 0 20rpx 30rpx 20rpx; +} +.content .item .number { + background: #f2f2f2; + width: calc(40% - 40rpx); +} +.content .item .price { + width: calc(60% - 40rpx) +} +.content .item .number, +.content .item .price { + padding: 20rpx; +} +.content .item .number .value { + color: #666; +} +.content .item .price .value, +.content .item .price .symbol { + color: #1d1611; +} +.content .item .value { + font-size: 38rpx; +} +.content .item .unit { + color: #888; + margin-left: 10rpx; +} +.content .active { + border-color: #1d1611; + box-shadow: 0px 0 0px 1px #1d1611 +} +.content .submit-bottom { + background: #f9d681 !important; + color: #351d06 !important; +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip/membervip.js b/public/appmini/old/weixin/pages/membervip/membervip.js new file mode 100644 index 000000000..9c58190c4 --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip/membervip.js @@ -0,0 +1,86 @@ +const app = getApp(); +Page({ + data: { + data_bottom_line_status: false, + data_list_loding_status: 1, + data_list_loding_msg: '', + data_list: [], + data_base: null, + }, + + onLoad(params) { + this.init(); + }, + + onShow() { + wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip }); + }, + + init() { + // 获取数据 + this.get_data_list(); + }, + + // 获取数据 + get_data_list() { + var self = this; + wx.showLoading({ title: "加载中..." }); + if (self.data.data_list.length <= 0) { + self.setData({ + data_list_loding_status: 1 + }); + } + + wx.request({ + url: app.get_request_url("index", "index", "membershiplevelvip"), + method: "POST", + data: {}, + dataType: "json", + success: res => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + if (res.data.code == 0) { + var data = res.data.data; + var status = ((data.data || []).length > 0); + self.setData({ + data_base: data.base || null, + data_list: data.data || [], + data_list_loding_msg: '', + data_list_loding_status: status ? 3 : 0, + data_bottom_line_status: status, + }); + + // 导航名称 + if ((data.base || null) != null && (data.base.application_name || null) != null) { + wx.setNavigationBarTitle({ title: data.base.application_name }); + } + } else { + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: res.data.msg, + }); + if (app.is_login_check(res.data, self, 'get_data_list')) { + app.showToast(res.data.msg); + } + } + }, + fail: () => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: '服务器请求出错', + }); + app.showToast("服务器请求出错"); + } + }); + }, + + // 下拉刷新 + onPullDownRefresh() { + this.get_data_list(); + }, + +}); \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip/membervip.json b/public/appmini/old/weixin/pages/membervip/membervip.json new file mode 100644 index 000000000..d7bf94c8d --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip/membervip.json @@ -0,0 +1,5 @@ +{ + "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#1d1611", + "backgroundColor": "#1d1611" +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip/membervip.wxml b/public/appmini/old/weixin/pages/membervip/membervip.wxml new file mode 100644 index 000000000..0028c1225 --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip/membervip.wxml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/membervip/membervip.wxss b/public/appmini/old/weixin/pages/membervip/membervip.wxss new file mode 100644 index 000000000..4ee246eab --- /dev/null +++ b/public/appmini/old/weixin/pages/membervip/membervip.wxss @@ -0,0 +1,71 @@ +/** + * banner + */ +.banner { + background-color: #1d1611; + background-position: center center; + background-repeat: no-repeat; + position: relative; + height: 1110rpx; + width: 100%; + overflow: hidden; +} +.banner .banner-title { + font-size: 60rpx; + margin-top: 50rpx; + color: #f9d681; + height: 68rpx; + overflow: hidden; +} +.banner .submit { + margin-top: 60rpx; +} +.banner .submit button { + border: 1rpx solid #f9d681; + background-color: #f9d681; + color: #351d06; + width: 320rpx; + height: 80rpx; + line-height: 80rpx; + font-size: 36rpx; + border-radius: 50rpx; + font-weight: 500; +} + +/** + * 等级介绍 + */ +.data-list { + margin-top: 40rpx; +} +.data-list .item { + padding: 15rpx; + width: calc(50% - 30rpx); +} +.data-list .item .content { + overflow: hidden; + border-radius: 8rpx; + background-color: #fff; + padding: 30rpx 10rpx; +} +.data-list .item .content .title { + height: 36rpx; + line-height: 36rpx; + font-size: 36rpx; + color: #333; +} +.data-list .item .content .desc { + height: 76rpx; + line-height: 38rpx; + font-size: 30rpx; + color: #999; +} +.data-list .item .content .title, +.data-list .item .content .desc { + margin-bottom: 15rpx; +} +.data-list .item .content image { + max-width: 160rpx; + max-height: 160rpx; + margin:0 auto; +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/user-membervip/user-membervip.js b/public/appmini/old/weixin/pages/user-membervip/user-membervip.js new file mode 100644 index 000000000..bb1e8bcc4 --- /dev/null +++ b/public/appmini/old/weixin/pages/user-membervip/user-membervip.js @@ -0,0 +1,128 @@ +const app = getApp(); +Page({ + data: { + data_bottom_line_status: false, + data_list_loding_status: 1, + data_list_loding_msg: '', + data_base: null, + user_vip: null, + avatar: app.data.default_user_head_src, + nickname: "用户名", + + nav_list: [ + { + icon: "/images/share-weixin-icon.png", + cs: "br-t br-b br-r", + title: "推广返利", + }, + { + icon: "/images/share-weixin-icon.png", + cs: "br-t br-b", + title: "收益明细", + } + ], + }, + + onLoad(params) { + this.init(); + }, + + onShow() { + wx.setNavigationBarTitle({ title: app.data.common_pages_title.membervip }); + }, + + init(e) { + var user = app.get_user_info(this, "init"), + self = this; + if (user != false) { + // 用户未绑定用户则转到登录页面 + if (app.user_is_need_login(user)) { + wx.showModal({ + title: '温馨提示', + content: '绑定手机号码', + confirmText: '确认', + cancelText: '暂不', + success: (result) => { + wx.stopPullDownRefresh(); + if (result.confirm) { + wx.navigateTo({ + url: "/pages/login/login?event_callback=init" + }); + } + self.setData({ + avatar: user.avatar || app.data.default_user_head_src, + nickname: user.user_name_view || '用户名', + }); + }, + }); + } else { + self.get_data(); + } + } + }, + + // 获取数据 + get_data() { + var self = this; + wx.request({ + url: app.get_request_url("index", "vip", "membershiplevelvip"), + method: "POST", + data: {}, + dataType: "json", + success: res => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + if (res.data.code == 0) { + var data = res.data.data; + self.setData({ + data_base: data.base || null, + user_vip: data.user_vip || null, + data_list_loding_msg: '', + data_list_loding_status: 0, + data_bottom_line_status: false, + }); + } else { + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: res.data.msg, + }); + if (app.is_login_check(res.data, self, 'get_data')) { + app.showToast(res.data.msg); + } + } + }, + fail: () => { + wx.hideLoading(); + wx.stopPullDownRefresh(); + self.setData({ + data_bottom_line_status: false, + data_list_loding_status: 2, + data_list_loding_msg: '服务器请求出错', + }); + app.showToast("服务器请求出错"); + } + }); + }, + + // 下拉刷新 + onPullDownRefresh() { + this.get_data(); + }, + + // 头像查看 + preview_event() { + if (app.data.default_user_head_src != this.data.avatar) { + wx.previewImage({ + current: this.data.avatar, + urls: [this.data.avatar] + }); + } + }, + + // 头像加载错误 + user_avatar_error(e) { + this.setData({ avatar: app.data.default_user_head_src }); + }, + +}); \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/user-membervip/user-membervip.json b/public/appmini/old/weixin/pages/user-membervip/user-membervip.json new file mode 100644 index 000000000..d7bf94c8d --- /dev/null +++ b/public/appmini/old/weixin/pages/user-membervip/user-membervip.json @@ -0,0 +1,5 @@ +{ + "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#1d1611", + "backgroundColor": "#1d1611" +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxml b/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxml new file mode 100644 index 000000000..c7ea8372a --- /dev/null +++ b/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxml @@ -0,0 +1,51 @@ + + + + + {{nickname}} + + + VIP1 + + + 有效期 + {{user_vip.permanent_value}} + {{user_vip.permanent_unit}} + + + + 会员已过期或未开通 + + + + + + 有效期 + {{user_vip.surplus_time_number}} + {{user_vip.surplus_time_unit}} + + + + + + + + + + + + + + + + + + + + + + + {{item.title}} + + + \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxss b/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxss new file mode 100644 index 000000000..cdfcc3170 --- /dev/null +++ b/public/appmini/old/weixin/pages/user-membervip/user-membervip.wxss @@ -0,0 +1,82 @@ +/* + * 头部 + */ +.head-box{ + padding-top: 20rpx; + font-size: 24rpx; + background-color: #1d1611; + position: relative; +} +.head-item { + padding-bottom: 30rpx; +} +.head-item .avatar { + width: 160rpx; + height: 160rpx; + border-radius: 50%; + border: 1px solid #3d3c3c; +} +.head-item .item-name{ + font-size: 30rpx; + margin-top: 10rpx; +} +.head-item .item-icon { + width: 30rpx; + margin-right: 20rpx; +} +.head-item { + margin-left: 30rpx; +} +.head-base { + margin-left: 60rpx; + width: calc(100% - 280rpx); +} +.head-base .value { + font-weight: 500; + font-size: 36rpx; +} +.head-base .title, +.head-base .unit { + color: #9e9e9e; +} +.head-base .value, +.head-base .unit { + margin-left: 10rpx; +} +.head-base .level-name { + font-size: 42rpx; + font-weight: 500; + margin-bottom: 30rpx; + color: #e4cb96; +} +.head-base .submit-buy { + font-size: 26rpx; + height: 55rpx; + line-height: 55rpx; + border: 1px solid #f9d681; + background-color: #f9d681; + color: #351d06; + position: absolute; + right: 30rpx; + bottom: 35rpx; + padding: 0 20rpx; +} + +/* + * 导航 + */ +.nav { + +} +.nav .item { + padding: 20rpx; + width: calc(50% - 30px); +} +.nav .item image { + width: 100rpx; + height: 100rpx; + margin: 0 auto; +} +.nav .item .title { + margin-top: 20rpx; +} \ No newline at end of file diff --git a/public/appmini/old/weixin/pages/user/user.json b/public/appmini/old/weixin/pages/user/user.json index 1e8b450ba..69994ec5d 100755 --- a/public/appmini/old/weixin/pages/user/user.json +++ b/public/appmini/old/weixin/pages/user/user.json @@ -1,5 +1,7 @@ { "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#d2364c", + "backgroundColor": "#d2364c", "usingComponents": { "component-badge": "/components/badge/badge" } diff --git a/public/appmini/old/weixin/pages/user/user.wxml b/public/appmini/old/weixin/pages/user/user.wxml index f8e36a724..f1b1c4396 100755 --- a/public/appmini/old/weixin/pages/user/user.wxml +++ b/public/appmini/old/weixin/pages/user/user.wxml @@ -78,6 +78,5 @@ -