@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@ -1,137 +0,0 @@
|
||||
const api = require('./utils/request.js')
|
||||
App({
|
||||
navigateToLogin: false,
|
||||
onLaunch: function() {
|
||||
var that = this;
|
||||
/**
|
||||
* 初次加载判断网络情况
|
||||
* 无网络状态下根据实际情况进行调整
|
||||
*/
|
||||
wx.getNetworkType({
|
||||
success(res) {
|
||||
const networkType = res.networkType
|
||||
if (networkType === 'none') {
|
||||
that.globalData.isConnected = false
|
||||
wx.showToast({
|
||||
title: '当前无网络',
|
||||
icon: 'loading',
|
||||
duration: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* 监听网络状态变化
|
||||
* 可根据业务需求进行调整
|
||||
*/
|
||||
wx.onNetworkStatusChange(function(res) {
|
||||
if (!res.isConnected) {
|
||||
that.globalData.isConnected = false
|
||||
wx.showToast({
|
||||
title: '网络已断开',
|
||||
icon: 'loading',
|
||||
duration: 2000,
|
||||
complete: function() {
|
||||
that.goStartIndexPage()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.globalData.isConnected = true
|
||||
wx.hideToast()
|
||||
}
|
||||
});
|
||||
// 获取商城名称
|
||||
api.fetchRequest('/config/get-value', {
|
||||
key: 'mallName'
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
wx.setStorageSync('mallName', res.data.data.value);
|
||||
}
|
||||
})
|
||||
api.fetchRequest('/score/send/rule', {
|
||||
code: 'goodReputation'
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.globalData.order_reputation_score = res.data.data[0].score;
|
||||
}
|
||||
})
|
||||
api.fetchRequest('/config/get-value', {
|
||||
key: 'recharge_amount_min'
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.globalData.recharge_amount_min = res.data.data.value;
|
||||
}
|
||||
})
|
||||
// 获取砍价设置
|
||||
api.fetchRequest('/shop/goods/kanjia/list').then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.globalData.kanjiaList = res.data.data.result;
|
||||
}
|
||||
})
|
||||
// 判断是否登录
|
||||
let token = wx.getStorageSync('token');
|
||||
if (!token) {
|
||||
that.goLoginPageTimeOut()
|
||||
return
|
||||
}
|
||||
api.fetchRequest('/user/check-token', {
|
||||
token: token
|
||||
}).then(function(res) {
|
||||
if (res.data.code != 0) {
|
||||
wx.removeStorageSync('token')
|
||||
that.goLoginPageTimeOut()
|
||||
}
|
||||
})
|
||||
},
|
||||
sendTempleMsg: function(orderId, trigger, template_id, form_id, page, postJsonString) {
|
||||
var that = this;
|
||||
api.fetchRequest('/template-msg/put', {
|
||||
token: wx.getStorageSync('token'),
|
||||
type: 0,
|
||||
module: 'order',
|
||||
business_id: orderId,
|
||||
trigger: trigger,
|
||||
template_id: template_id,
|
||||
form_id: form_id,
|
||||
url: page,
|
||||
postJsonString: postJsonString
|
||||
}, 'POST', 0, {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}).then(function(res) {})
|
||||
},
|
||||
sendTempleMsgImmediately: function(template_id, form_id, page, postJsonString) {
|
||||
var that = this;
|
||||
api.fetchRequest('/template-msg/put', {
|
||||
token: wx.getStorageSync('token'),
|
||||
type: 0,
|
||||
module: 'immediately',
|
||||
template_id: template_id,
|
||||
form_id: form_id,
|
||||
url: page,
|
||||
postJsonString: postJsonString
|
||||
}, 'POST', 0, {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}).then(function(res) {})
|
||||
},
|
||||
goLoginPageTimeOut: function() {
|
||||
if (this.navigateToLogin){
|
||||
return
|
||||
}
|
||||
this.navigateToLogin = true
|
||||
setTimeout(function() {
|
||||
wx.navigateTo({
|
||||
url: "/pages/authorize/index"
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
goStartIndexPage: function() {
|
||||
setTimeout(function() {
|
||||
wx.redirectTo({
|
||||
url: "/pages/start/start"
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
globalData: {
|
||||
isConnected: true
|
||||
}
|
||||
})
|
@ -1,56 +0,0 @@
|
||||
{
|
||||
"pages":[
|
||||
"pages/start/start",
|
||||
"pages/index/index",
|
||||
"pages/goods-details/index",
|
||||
"pages/shop-cart/index",
|
||||
"pages/to-pay-order/index",
|
||||
"pages/select-address/index",
|
||||
"pages/address-add/index",
|
||||
"pages/order-list/index",
|
||||
"pages/order-details/index",
|
||||
"pages/wuliu/index",
|
||||
"pages/mycoupons/index",
|
||||
"pages/my/index",
|
||||
"pages/notice/show",
|
||||
"pages/recharge/index",
|
||||
"pages/withdraw/index",
|
||||
"pages/kanjia/index",
|
||||
"pages/authorize/index",
|
||||
"pages/score-excharge/index"
|
||||
],
|
||||
"window":{
|
||||
"backgroundTextStyle":"light",
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "WeChat",
|
||||
"navigationBarTextStyle":"black",
|
||||
"onReachBottomDistance":50
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#6e6d6b",
|
||||
"selectedColor": "#e64340",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#fff",
|
||||
"box-shadow":"0 0 6px 0",
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "images/nav/home-off.png",
|
||||
"selectedIconPath": "images/nav/home-on.png",
|
||||
"text": "首页"
|
||||
}, {
|
||||
"pagePath": "pages/shop-cart/index",
|
||||
"iconPath": "images/nav/cart-off.png",
|
||||
"selectedIconPath": "images/nav/cart-on.png",
|
||||
"text": "购物车"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/index",
|
||||
"iconPath": "images/nav/my-off.png",
|
||||
"selectedIconPath": "images/nav/my-on.png",
|
||||
"text": "我的"
|
||||
}]
|
||||
},
|
||||
"navigateToMiniProgramAppIdList": [
|
||||
"wx56c8f077de74b07c","wxdc9f23490d56599c"
|
||||
]
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/**app.wxss**/
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.wxParse-img {
|
||||
display: block !important;
|
||||
}
|
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 961 B |
Before Width: | Height: | Size: 962 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 2.0 KiB |
@ -1,288 +0,0 @@
|
||||
var commonCityData = require('../../utils/city.js')
|
||||
const api = require('../../utils/request.js')
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
provinces:[],
|
||||
citys:[],
|
||||
districts:[],
|
||||
selProvince:'请选择',
|
||||
selCity:'请选择',
|
||||
selDistrict:'请选择',
|
||||
selProvinceIndex:0,
|
||||
selCityIndex:0,
|
||||
selDistrictIndex:0
|
||||
},
|
||||
bindCancel:function () {
|
||||
wx.navigateBack({})
|
||||
},
|
||||
bindSave: function(e) {
|
||||
var that = this;
|
||||
var linkMan = e.detail.value.linkMan;
|
||||
var address = e.detail.value.address;
|
||||
var mobile = e.detail.value.mobile;
|
||||
var code = e.detail.value.code;
|
||||
|
||||
if (linkMan == ""){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请填写联系人姓名',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (mobile == ""){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请填写手机号码',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.data.selProvince == "请选择"){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请选择地区',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.data.selCity == "请选择"){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请选择地区',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
var cityId = commonCityData.cityData[this.data.selProvinceIndex].cityList[this.data.selCityIndex].id;
|
||||
var districtId;
|
||||
if (this.data.selDistrict == "请选择" || !this.data.selDistrict){
|
||||
districtId = '';
|
||||
} else {
|
||||
districtId = commonCityData.cityData[this.data.selProvinceIndex].cityList[this.data.selCityIndex].districtList[this.data.selDistrictIndex].id;
|
||||
}
|
||||
if (address == ""){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请填写详细地址',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (code == ""){
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '请填写邮编',
|
||||
showCancel:false
|
||||
})
|
||||
return
|
||||
}
|
||||
var apiAddoRuPDATE = "add";
|
||||
var apiAddid = that.data.id;
|
||||
if (apiAddid) {
|
||||
apiAddoRuPDATE = "update";
|
||||
} else {
|
||||
apiAddid = 0;
|
||||
}
|
||||
api.fetchRequest(`/user/shipping-address/${apiAddoRuPDATE}`, {
|
||||
token: wx.getStorageSync('token'),
|
||||
id: apiAddid,
|
||||
provinceId: commonCityData.cityData[this.data.selProvinceIndex].id,
|
||||
cityId: cityId,
|
||||
districtId: districtId,
|
||||
linkMan: linkMan,
|
||||
address: address,
|
||||
mobile: mobile,
|
||||
code: code,
|
||||
isDefault: 'true'
|
||||
}).then(function (res) {
|
||||
if (res.data.code != 0) {
|
||||
// 登录错误
|
||||
wx.hideLoading();
|
||||
wx.showModal({
|
||||
title: '失败',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
// 跳转到结算页面
|
||||
wx.navigateBack({})
|
||||
})
|
||||
},
|
||||
initCityData:function(level, obj){
|
||||
if(level == 1){
|
||||
var pinkArray = [];
|
||||
for(var i = 0;i<commonCityData.cityData.length;i++){
|
||||
pinkArray.push(commonCityData.cityData[i].name);
|
||||
}
|
||||
this.setData({
|
||||
provinces:pinkArray
|
||||
});
|
||||
} else if (level == 2){
|
||||
var pinkArray = [];
|
||||
var dataArray = obj.cityList
|
||||
for(var i = 0;i<dataArray.length;i++){
|
||||
pinkArray.push(dataArray[i].name);
|
||||
}
|
||||
this.setData({
|
||||
citys:pinkArray
|
||||
});
|
||||
} else if (level == 3){
|
||||
var pinkArray = [];
|
||||
var dataArray = obj.districtList
|
||||
for(var i = 0;i<dataArray.length;i++){
|
||||
pinkArray.push(dataArray[i].name);
|
||||
}
|
||||
this.setData({
|
||||
districts:pinkArray
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
bindPickerProvinceChange:function(event){
|
||||
var selIterm = commonCityData.cityData[event.detail.value];
|
||||
this.setData({
|
||||
selProvince:selIterm.name,
|
||||
selProvinceIndex:event.detail.value,
|
||||
selCity:'请选择',
|
||||
selCityIndex:0,
|
||||
selDistrict:'请选择',
|
||||
selDistrictIndex: 0
|
||||
})
|
||||
this.initCityData(2, selIterm)
|
||||
},
|
||||
bindPickerCityChange:function (event) {
|
||||
var selIterm = commonCityData.cityData[this.data.selProvinceIndex].cityList[event.detail.value];
|
||||
this.setData({
|
||||
selCity:selIterm.name,
|
||||
selCityIndex:event.detail.value,
|
||||
selDistrict: '请选择',
|
||||
selDistrictIndex: 0
|
||||
})
|
||||
this.initCityData(3, selIterm)
|
||||
},
|
||||
bindPickerChange:function (event) {
|
||||
var selIterm = commonCityData.cityData[this.data.selProvinceIndex].cityList[this.data.selCityIndex].districtList[event.detail.value];
|
||||
if (selIterm && selIterm.name && event.detail.value) {
|
||||
this.setData({
|
||||
selDistrict: selIterm.name,
|
||||
selDistrictIndex: event.detail.value
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad: function (e) {
|
||||
var that = this;
|
||||
this.initCityData(1);
|
||||
var id = e.id;
|
||||
if (id) {
|
||||
// 初始化原数据
|
||||
wx.showLoading();
|
||||
api.fetchRequest('/user/shipping-address/detail', {
|
||||
token: wx.getStorageSync('token'),
|
||||
id: id
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
id: id,
|
||||
addressData: res.data.data,
|
||||
selProvince: res.data.data.provinceStr,
|
||||
selCity: res.data.data.cityStr,
|
||||
selDistrict: res.data.data.areaStr
|
||||
});
|
||||
that.setDBSaveAddressId(res.data.data);
|
||||
return;
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '无法获取快递地址数据',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
}).finally(function() {
|
||||
wx.hideLoading();
|
||||
})
|
||||
}
|
||||
},
|
||||
setDBSaveAddressId: function(data) {
|
||||
var retSelIdx = 0;
|
||||
for (var i = 0; i < commonCityData.cityData.length; i++) {
|
||||
if (data.provinceId == commonCityData.cityData[i].id) {
|
||||
this.data.selProvinceIndex = i;
|
||||
for (var j = 0; j < commonCityData.cityData[i].cityList.length; j++) {
|
||||
if (data.cityId == commonCityData.cityData[i].cityList[j].id) {
|
||||
this.data.selCityIndex = j;
|
||||
for (var k = 0; k < commonCityData.cityData[i].cityList[j].districtList.length; k++) {
|
||||
if (data.districtId == commonCityData.cityData[i].cityList[j].districtList[k].id) {
|
||||
this.data.selDistrictIndex = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
selectCity: function () {
|
||||
|
||||
},
|
||||
deleteAddress: function (e) {
|
||||
var that = this;
|
||||
var id = e.currentTarget.dataset.id;
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除该收货地址吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
api.fetchRequest('/user/shipping-address/delete', {
|
||||
token: wx.getStorageSync('token'),
|
||||
id: id
|
||||
}).then(function (res) {
|
||||
wx.navigateBack({})
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
readFromWx : function () {
|
||||
let that = this;
|
||||
wx.chooseAddress({
|
||||
success: function (res) {
|
||||
let provinceName = res.provinceName;
|
||||
let cityName = res.cityName;
|
||||
let diatrictName = res.countyName;
|
||||
let retSelIdx = 0;
|
||||
|
||||
for (var i = 0; i < commonCityData.cityData.length; i++) {
|
||||
if (provinceName == commonCityData.cityData[i].name) {
|
||||
let eventJ = { detail: { value:i }};
|
||||
that.bindPickerProvinceChange(eventJ);
|
||||
that.data.selProvinceIndex = i;
|
||||
for (var j = 0; j < commonCityData.cityData[i].cityList.length; j++) {
|
||||
if (cityName == commonCityData.cityData[i].cityList[j].name) {
|
||||
//that.data.selCityIndex = j;
|
||||
eventJ = { detail: { value: j } };
|
||||
that.bindPickerCityChange(eventJ);
|
||||
for (var k = 0; k < commonCityData.cityData[i].cityList[j].districtList.length; k++) {
|
||||
if (diatrictName == commonCityData.cityData[i].cityList[j].districtList[k].name) {
|
||||
//that.data.selDistrictIndex = k;
|
||||
eventJ = { detail: { value: k } };
|
||||
that.bindPickerChange(eventJ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
that.setData({
|
||||
wxaddress: res,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "新增地址"
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
<view class="container">
|
||||
<form bindsubmit="bindSave">
|
||||
<view class="form-box">
|
||||
<view class="row-wrap">
|
||||
<view class="label">联系人</view>
|
||||
<view class="label-right">
|
||||
<input name="linkMan" class="input" type="text" placeholder="姓名" value="{{addressData.linkMan}}{{wxaddress.userName}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row-wrap">
|
||||
<view class="label">手机号码</view>
|
||||
<view class="label-right">
|
||||
<input name="mobile" class="input" maxlength="11" type="number" placeholder="11位手机号码" value="{{addressData.mobile}}{{wxaddress.telNumber}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row-wrap" bindtap="selectCity">
|
||||
<view class="label">选择地区</view>
|
||||
<picker bindchange="bindPickerProvinceChange" range="{{provinces}}">
|
||||
<view class="picker {{selProvince=='请选择'?'hui':''}}">
|
||||
{{selProvince}}
|
||||
</view>
|
||||
</picker>
|
||||
<picker bindchange="bindPickerCityChange" range="{{citys}}">
|
||||
<view class="picker {{selCity=='请选择'?'hui':''}}">
|
||||
{{selCity}}
|
||||
</view>
|
||||
</picker>
|
||||
<picker bindchange="bindPickerChange" range="{{districts}}">
|
||||
<view class="picker {{selDistrict=='请选择'?'hui':''}}">
|
||||
{{selDistrict}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="addr-details">
|
||||
<view class="label">详细地址</view>
|
||||
<view class="label-right">
|
||||
<!--<input class="input" type="text" placeholder="街道门牌信息"/>-->
|
||||
<textarea name="address" auto-height placeholder="街道门牌信息" value="{{addressData.address}}{{wxaddress.detailInfo}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row-wrap">
|
||||
<view class="label">邮政编号</view>
|
||||
<view class="label-right">
|
||||
<input name="code" class="input" type="text" value="{{addressData.code}}{{wxaddress.postalCode}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="warn" class="save-btn" formType="submit">保存</button>
|
||||
<button wx:if="{{!addressData}}" type="primary" class="save-btn" bindtap="readFromWx">从微信读取</button>
|
||||
<button type="default" class="save-btn" bindtap="deleteAddress" data-id="{{addressData.id}}" wx:if="{{addressData}}">删除该地址</button>
|
||||
<button type="default" class="cancel-btn" bindtap="bindCancel">取消</button>
|
||||
</form>
|
||||
</view>
|
@ -1,87 +0,0 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.container{
|
||||
background-color: #f5f5f9;
|
||||
justify-content: initial;
|
||||
}
|
||||
.form-box{
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.row-wrap{
|
||||
width: 720rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.row-wrap .label{
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.row-wrap .label-right{
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.row-wrap .label-right input{
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.row-wrap .right-box{
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.arrow-right{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.save-btn,
|
||||
.cancel-btn{
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
border-radius: 6rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.save-btn{
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
}
|
||||
button[type="default"]{
|
||||
background-color: #ffffff;
|
||||
color:#000;
|
||||
}
|
||||
.addr-details{
|
||||
height: auto;
|
||||
padding: 30rpx 0;
|
||||
margin-left:30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.addr-details .label{
|
||||
margin:auto 0 auto 0;
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.addr-details textarea{
|
||||
box-sizing: border-box;
|
||||
width: 480rpx;
|
||||
overflow: scroll;
|
||||
}
|
||||
picker {
|
||||
min-width: 20rpx;
|
||||
height: 100%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.hui{
|
||||
color: #777;
|
||||
}
|
@ -1,155 +0,0 @@
|
||||
const api = require('../../utils/request.js')
|
||||
var app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
|
||||
},
|
||||
bindGetUserInfo: function(e) {
|
||||
if (!e.detail.userInfo) {
|
||||
return;
|
||||
}
|
||||
if (app.globalData.isConnected) {
|
||||
wx.setStorageSync('userInfo', e.detail.userInfo)
|
||||
this.login();
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '当前无网络',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
},
|
||||
login: function() {
|
||||
let that = this;
|
||||
let token = wx.getStorageSync('token');
|
||||
if (token) {
|
||||
api.fetchRequest('/user/check-token').then(function(res) {
|
||||
if (res.data.code != 0) {
|
||||
wx.removeStorageSync('token')
|
||||
that.login();
|
||||
} else {
|
||||
// 回到原来的地方放
|
||||
app.navigateToLogin = false
|
||||
wx.navigateBack();
|
||||
}
|
||||
})
|
||||
return;
|
||||
}
|
||||
wx.login({
|
||||
success: function(res) {
|
||||
api.fetchRequest('/user/wxapp/login', {
|
||||
code: res.code
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 10000) {
|
||||
// 去注册
|
||||
that.registerUser();
|
||||
return;
|
||||
}
|
||||
if (res.data.code != 0) {
|
||||
// 登录错误
|
||||
wx.hideLoading();
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '无法登录,请重试',
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
wx.setStorageSync('token', res.data.data.token)
|
||||
wx.setStorageSync('uid', res.data.data.uid)
|
||||
// 回到原来的地方放
|
||||
app.navigateToLogin = false
|
||||
wx.navigateBack();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
registerUser: function() {
|
||||
let that = this;
|
||||
wx.login({
|
||||
success: function(res) {
|
||||
let code = res.code; // 微信登录接口返回的 code 参数,下面注册接口需要用到
|
||||
wx.getUserInfo({
|
||||
success: function(res) {
|
||||
let iv = res.iv;
|
||||
let encryptedData = res.encryptedData;
|
||||
let referrer = '' // 推荐人
|
||||
let referrer_storge = wx.getStorageSync('referrer');
|
||||
if (referrer_storge) {
|
||||
referrer = referrer_storge;
|
||||
}
|
||||
// 下面开始调用注册接口
|
||||
api.fetchRequest('/user/wxapp/register/complex', {
|
||||
code: code,
|
||||
encryptedData: encryptedData,
|
||||
iv: iv,
|
||||
referrer: referrer
|
||||
}).then(function(res) {
|
||||
wx.hideLoading();
|
||||
that.login();
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "用户信息授权"
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.container{
|
||||
background-color: #f5f5f9;
|
||||
justify-content: initial;
|
||||
}
|
||||
.form-box{
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.row-wrap{
|
||||
width: 720rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.row-wrap .label{
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.row-wrap .label-right{
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.row-wrap .label-right input{
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.row-wrap .right-box{
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.arrow-right{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.save-btn,
|
||||
.cancel-btn{
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
border-radius: 6rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.save-btn{
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
}
|
||||
button[type="default"]{
|
||||
background-color: #ffffff;
|
||||
color:#000;
|
||||
}
|
||||
.addr-details{
|
||||
height: auto;
|
||||
padding: 30rpx 0;
|
||||
margin-left:30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.addr-details .label{
|
||||
margin:auto 0 auto 0;
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.addr-details textarea{
|
||||
box-sizing: border-box;
|
||||
width: 480rpx;
|
||||
overflow: scroll;
|
||||
}
|
||||
picker {
|
||||
min-width: 20rpx;
|
||||
height: 100%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.hui{
|
||||
color: #777;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
@ -1,344 +0,0 @@
|
||||
@import "/wxParse/wxParse.wxss";
|
||||
|
||||
.container {
|
||||
background-color: #F2f2f2;
|
||||
min-height: 100%;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.swiper-container{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.swiper_box {
|
||||
width: 100%;
|
||||
height:748rpx;
|
||||
}
|
||||
|
||||
swiper-item image {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
height:748rpx;
|
||||
}
|
||||
.swiper-container .dots{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.swiper-container .dots .dot{
|
||||
margin: 0 8rpx;
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
background: #000;
|
||||
border-radius: 50%;
|
||||
transition: all .6s;
|
||||
opacity: .3;
|
||||
}
|
||||
.swiper-container .dots .dot.active{
|
||||
opacity: .6;
|
||||
}
|
||||
.goods-info{
|
||||
background-color: #fff;
|
||||
padding: 35rpx 0;
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.goods-info-fx {
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 60px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.goods-info-fx button {
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 60px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.goods-info-fx image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
margin: 10px 10px 0 5px;
|
||||
}
|
||||
|
||||
.goods-info-fx text {
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.goods-info .goods-title{
|
||||
box-sizing: border-box;
|
||||
padding: 0 35rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 1.4;
|
||||
color: #000;
|
||||
margin-bottom: 28rpx;
|
||||
padding-right: 60px;
|
||||
}
|
||||
.goods-info .goods-share{
|
||||
box-sizing: border-box;
|
||||
padding: 0 35rpx;
|
||||
font-size: 25rpx;
|
||||
line-height: 1.4;
|
||||
color: #CC0000;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
.goods-info .goods-price{
|
||||
box-sizing:border-box;
|
||||
color:#e64340;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
width: 30%;
|
||||
float:left;
|
||||
}
|
||||
.row-arrow{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 120rpx 0 35rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
height: 102rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 102rpx;
|
||||
margin-bottom: 28rpx;
|
||||
background: #fff url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 697rpx center;
|
||||
background-size: 18rpx auto;
|
||||
}
|
||||
.goods-des-info{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
.label-title{
|
||||
font-size:28rpx;
|
||||
color:#000000;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.goods-text{
|
||||
padding: 0 10rpx;
|
||||
font-size:28rpx;
|
||||
color:#666666;
|
||||
line-height: 56rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.des-imgs{
|
||||
width:100%;
|
||||
}
|
||||
.des-imgs image{
|
||||
width: 100%;
|
||||
}
|
||||
.footer-box{
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
box-shadow:0 0 8rpx 0 ;
|
||||
}
|
||||
.footer-box .contact {
|
||||
position: relative;
|
||||
width: 120rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/*line-height: 100rpx;
|
||||
text-align: center;
|
||||
padding-top: 26rpx;*/
|
||||
font-size: 20rpx;
|
||||
color: #008000;
|
||||
box-sizing: border-box;
|
||||
background: url("https://cdn.it120.cc/images/weappshop/kefu.png") no-repeat center 21rpx;
|
||||
background-size: 55rpx auto;
|
||||
}
|
||||
.footer-box .shop-cart-btn {
|
||||
position: relative;
|
||||
width: 135rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
font-size: 20rpx;
|
||||
color: #acacb7;
|
||||
box-sizing: border-box;
|
||||
background: url("https://cdn.it120.cc/images/weappshop/cart.png") no-repeat center 21rpx;
|
||||
background-size: 44rpx auto;
|
||||
}
|
||||
.footer-box .shop-cart-btn .shop-num{
|
||||
position: absolute;
|
||||
color:#e64340;
|
||||
left: 85rpx;
|
||||
top:10rpx;
|
||||
}
|
||||
.footer-box .join-shop-cart{
|
||||
text-align: center;
|
||||
width: 250rpx;
|
||||
height: 100%;
|
||||
line-height: 100rpx;
|
||||
background-color: #ff6850;
|
||||
color:#fff;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.footer-box .now-buy{
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
width: 250rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.show-popup{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
z-index: 4;
|
||||
}
|
||||
.popup-mask{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 5;
|
||||
}
|
||||
.popup-contents{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
z-index: 6;
|
||||
}
|
||||
.pop-goods-info{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-left: 30rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.pop-img-box{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
.pop-img-box .goods-thumbnail{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
.pop-goods-title{
|
||||
width: 484rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
}
|
||||
.pop-goods-price{
|
||||
font-size:26rpx;
|
||||
color:#e64340;
|
||||
margin-top:20rpx;
|
||||
}
|
||||
.pop-goods-close{
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
flex: 1;
|
||||
background:url("https://cdn.it120.cc/images/weappshop/popup-close.png") no-repeat center center;
|
||||
background-size: 36rpx auto;
|
||||
align-self: flex-start;
|
||||
margin-top: -10rpx;
|
||||
}
|
||||
.size-label-box .label{
|
||||
font-size:26rpx;
|
||||
color:#000;
|
||||
padding-left: 30rpx;
|
||||
padding: 30rpx 0 20rpx 30rpx;
|
||||
}
|
||||
.size-label-box .label-item-box{
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
flex-direction: row;
|
||||
flex-wrap:wrap;
|
||||
}
|
||||
.size-label-box .label-item{
|
||||
font-size:26rpx;
|
||||
color:#000;
|
||||
padding: 14rpx 20rpx;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 6rpx;
|
||||
margin: 0 20rpx 20rpx 0;
|
||||
}
|
||||
.size-label-box .label-item.active{
|
||||
color: #e64340;
|
||||
border: 1px solid #e64340;
|
||||
}
|
||||
.buy-num-box{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 30rpx 48rpx 0;
|
||||
margin-left: 30rpx;
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
.num-label{
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
}
|
||||
.buy-num-box .num-box{
|
||||
display: flex;
|
||||
}
|
||||
.buy-num-box .num-box .num-jian,
|
||||
.buy-num-box .num-box .num-input,
|
||||
.buy-num-box .num-box .num-jia{
|
||||
width: 80rpx;
|
||||
height: 64rpx;
|
||||
line-height: 62rpx;
|
||||
text-align: center;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.buy-num-box .num-box .num-input{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.buy-num-box .num-box .num-input input{
|
||||
height: 100%;
|
||||
}
|
||||
.popup-join-btn{
|
||||
width: 100%;
|
||||
height: 89rpx;
|
||||
text-align: center;
|
||||
line-height: 89rpx;
|
||||
font-size:34rpx;
|
||||
color:#ffffff;
|
||||
background-color: #e64340;
|
||||
}
|
||||
.buy-num-box .num-box .hui{
|
||||
background-color: #f5f5f9;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"enablePullDownRefresh": true
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
<!--index.wxml-->
|
||||
<!--1px = 750/320 = 2.34rpx;-->
|
||||
<view class="container">
|
||||
<view class="swiper-container">
|
||||
<swiper class="swiper_box"
|
||||
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
|
||||
<block wx:for="{{banners}}" wx:key="id">
|
||||
<swiper-item>
|
||||
<image bindtap="tapBanner" data-id="{{item.businessId}}" src="{{item.picUrl}}_m" class="slide-image" width="750rpx" height="562.5rpx"/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
<view class="dots">
|
||||
<block wx:for="{{banners}}" wx:key="unique">
|
||||
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="type-container">
|
||||
<scroll-view class="type-navbar" scroll-x="true">
|
||||
<view class="type-box" wx:for-items="{{categories}}" wx:key="id">
|
||||
<view id="{{item.id}}" class="type-navbar-item {{activeCategoryId == item.id ? 'type-item-on' : ''}}" bindtap="tabClick">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="search-view" style="background:{{ scrollTop === 0 ?'-webkit-linear-gradient(top, rgba(105,195,170, 1), rgba(105,195,170, 0.3))' :( scrollTop<200 ? 'rgba(105,195,170,'+(scrollTop/400+0.3) +')' : 'rgba(105,195,170,1)') }} ">
|
||||
<view class="search-content">
|
||||
<image src="/images/search-pic.png" class="search-icon" />
|
||||
<input placeholder="请输入搜索内容" class="search-input" maxlength="30" confirm-type="搜索" bindinput='listenerSearchInput' bindconfirm='toSearch'>
|
||||
</input>
|
||||
<button class='search-btn' bindtap="toSearch">搜索
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{noticeList}}" class="notice">
|
||||
<view class="notice_iteml">公告:</view>
|
||||
<swiper wx:if="{{noticeList}}" class="notice_swiper" vertical="true" autoplay="true" circular="true" interval="3000">
|
||||
<navigator wx:for-items="{{noticeList.dataList}}" wx:key="id" url="/pages/notice/show?id={{item.id}}" open-type="navigate">
|
||||
<swiper-item >
|
||||
<view class="notice_itemr">{{item.title}}</view>
|
||||
</swiper-item>
|
||||
</navigator>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="coupons" hidden="{{hasNoCoupons}}">
|
||||
<scroll-view class="coupons-scroll" scroll-x="true">
|
||||
<view class="coupons-item" wx:for-items="{{coupons}}" wx:for-index="idx" wx:key="id" bindtap="gitCoupon" data-id="{{item.id}}">
|
||||
<view style="font-size: 35rpx"> ¥ {{item.moneyMax}}元 </view>
|
||||
<view> {{item.name}} </view>
|
||||
<view> 满 {{item.moneyHreshold}} 元使用 </view>
|
||||
<view wx:if="{{item.dateEndType == 0}}"> {{item.dateEnd}} 前有效 </view>
|
||||
<view wx:if="{{item.dateEndType == 1}}"> 领取 {{item.dateEndDays}} 天内有效 </view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="goods-container">
|
||||
<view class="goods-box" wx:for-items="{{goods}}" wx:key="{{index}}" bindtap="toDetailsTap" data-id="{{item.id}}">
|
||||
<view class="img-box">
|
||||
<image src="{{item.pic}}_m" class="image" mode="aspectFill" lazy-load="true"/>
|
||||
</view>
|
||||
<view class="goods-title">{{item.name}}</view>
|
||||
<view style='display:flex;'>
|
||||
<view class="goods-price">¥ {{item.minPrice}}</view>
|
||||
<view wx:if="{{item.originalPrice && item.originalPrice > 0}}" class="goods-price" style='color:#aaa;text-decoration:line-through'>¥ {{item.originalPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view hidden="{{loadingMoreHidden ? true : false}}" class="no-more-goods">没有更多啦</view>
|
||||
</view>
|
@ -1,239 +0,0 @@
|
||||
/**index.wxss**/
|
||||
|
||||
.container {
|
||||
background-color: #F2f2f2;
|
||||
min-height: 100%;
|
||||
display: block;
|
||||
}
|
||||
.swiper-container{
|
||||
width: 750rpx;
|
||||
position: relative;
|
||||
}
|
||||
.swiper_box {
|
||||
width: 100%;
|
||||
height:562.5rpx;
|
||||
}
|
||||
|
||||
swiper-item image {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
height:562.5rpx;
|
||||
}
|
||||
.swiper-container .dots{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.swiper-container .dots .dot{
|
||||
margin: 0 8rpx;
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
transition: all .6s;
|
||||
opacity: .5;
|
||||
}
|
||||
.swiper-container .dots .dot.active{
|
||||
width: 14rpx;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.type-navbar{
|
||||
white-space: nowrap;
|
||||
height: 88rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
.type-box{
|
||||
width:160rpx;
|
||||
box-sizing: content-box;
|
||||
font-size: 24rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.type-navbar-item{
|
||||
border-bottom: 4rpx solid #fff;
|
||||
}
|
||||
.type-item-on{
|
||||
border-bottom: 4rpx solid #e64340;
|
||||
}
|
||||
|
||||
.goods-container{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap:wrap;
|
||||
box-sizing: content-box;
|
||||
padding: 24rpx;
|
||||
}
|
||||
.goods-box{
|
||||
width: 339rpx;
|
||||
height: 472rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.goods-box .img-box{
|
||||
width: 339rpx;
|
||||
height: 339rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.goods-box .img-box image{
|
||||
width: 339rpx;
|
||||
height: 339rpx;
|
||||
}
|
||||
.goods-box .goods-title{
|
||||
width: 280rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
padding: 24rpx 0 0rpx 0;
|
||||
color:#000;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
.goods-box .goods-price{
|
||||
width: 280rpx;
|
||||
overflow: hidden;
|
||||
font-size: 24rpx;
|
||||
padding: 24rpx 0;
|
||||
color:#e64340;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
.no-more-goods{
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
padding-bottom:48rpx;
|
||||
color: #999;
|
||||
}
|
||||
.type-container{
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.notice{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap:wrap;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 750rpx;
|
||||
margin-top: 10rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.notice_swiper{
|
||||
padding-top: 15rpx;
|
||||
padding-bottom: 15rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
width: 635rpx;
|
||||
}
|
||||
.notice_iteml {
|
||||
padding-left: 25rpx;
|
||||
padding-top: 15rpx;
|
||||
padding-bottom: 15rpx;
|
||||
font-size: 26rpx;
|
||||
width: 80rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
color: #999;
|
||||
}
|
||||
.notice_itemr {
|
||||
padding-left: 10rpx;
|
||||
font-size: 26rpx;
|
||||
overflow: hidden;
|
||||
color: #e64340;
|
||||
width: 635rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.pos-fiexd{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.coupons{
|
||||
margin-top:10rpx;
|
||||
width: 100%;
|
||||
height: 180rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.coupons-scroll{
|
||||
white-space: nowrap;
|
||||
height: 180rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
.coupons-item{
|
||||
width:300rpx;
|
||||
height: 180rpx;
|
||||
margin: 10rpx;
|
||||
padding-top: 20rpx;
|
||||
padding-left: 15rpx;
|
||||
background-color: #f1a83b;
|
||||
box-sizing: content-box;
|
||||
font-size: 20rpx;
|
||||
line-height: 35rpx;
|
||||
overflow: hidden;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.search-view{
|
||||
position:fixed;
|
||||
left:0;
|
||||
right:0;
|
||||
top:0;
|
||||
z-index:500;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: gray;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.search-content{
|
||||
background: white;
|
||||
width:650rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding-top: auto;
|
||||
padding-left: 20rpx;
|
||||
padding-bottom: auto;
|
||||
margin: auto;
|
||||
height: 70rpx;
|
||||
border-radius:5px 5px;
|
||||
}
|
||||
.search-icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.search-input{
|
||||
width: 500rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.search-btn{
|
||||
width: 150rpx;
|
||||
height: 70rpx;
|
||||
margin-right: 0rpx;
|
||||
background-color:blueviolet;
|
||||
font-size: 28rpx;
|
||||
align-items: center;
|
||||
border-top-left-radius: 0rpx;
|
||||
border-bottom-left-radius: 0rpx;
|
||||
color:#fff;
|
||||
border:none;
|
||||
position: relative;
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
//index.js
|
||||
//获取应用实例
|
||||
var app = getApp();
|
||||
const api = require('../../utils/request.js')
|
||||
var WxParse = require('../../wxParse/wxParse.js');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
autoplay: true,
|
||||
interval: 3000,
|
||||
duration: 1000,
|
||||
goodsDetail: {},
|
||||
swiperCurrent: 0
|
||||
},
|
||||
|
||||
//事件处理函数
|
||||
swiperchange: function(e) {
|
||||
//console.log(e.detail.current)
|
||||
this.setData({
|
||||
swiperCurrent: e.detail.current
|
||||
})
|
||||
},
|
||||
onLoad: function(e) {
|
||||
this.data.id = e.id;
|
||||
this.data.kjId = e.kjId;
|
||||
this.data.joiner = e.joiner;
|
||||
},
|
||||
onShow: function() {
|
||||
var that = this
|
||||
api.fetchRequest('/shop/goods/detail', {
|
||||
id: that.data.id
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.data.goodsDetail = res.data.data;
|
||||
if (res.data.data.basicInfo.videoId) {
|
||||
that.getVideoSrc(res.data.data.basicInfo.videoId);
|
||||
}
|
||||
that.setData({
|
||||
goodsDetail: res.data.data
|
||||
});
|
||||
WxParse.wxParse('article', 'html', res.data.data.content, that, 5);
|
||||
that.getKanjiaInfo(that.data.kjId, that.data.joiner);
|
||||
that.getKanjiaInfoMyHelp(that.data.kjId, that.data.joiner);
|
||||
}
|
||||
})
|
||||
},
|
||||
onShareAppMessage: function() {
|
||||
var that = this;
|
||||
return {
|
||||
title: "帮我来砍价",
|
||||
path: "/pages/kanjia/index?kjId=" + that.data.kjId + "&joiner=" + that.data.joiner + "&id=" + that.data.id,
|
||||
success: function(res) {
|
||||
// 转发成功
|
||||
},
|
||||
fail: function(res) {
|
||||
// 转发失败
|
||||
}
|
||||
}
|
||||
},
|
||||
getVideoSrc: function(videoId) {
|
||||
var that = this;
|
||||
api.fetchRequest('/media/video/detail', {
|
||||
videoId: videoId
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
videoMp4Src: res.data.data.fdMp4
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
getKanjiaInfo: function(kjid, joiner) {
|
||||
var that = this;
|
||||
api.fetchRequest('/shop/goods/kanjia/info', {
|
||||
kjid: kjid,
|
||||
joiner: joiner,
|
||||
}).then(function(res) {
|
||||
if (res.data.code != 0) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
that.setData({
|
||||
kanjiaInfo: res.data.data
|
||||
});
|
||||
})
|
||||
},
|
||||
getKanjiaInfoMyHelp: function(kjid, joiner) {
|
||||
var that = this;
|
||||
api.fetchRequest('/shop/goods/kanjia/myHelp', {
|
||||
kjid: kjid,
|
||||
joinerUser: joiner,
|
||||
token: wx.getStorageSync('token')
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
kanjiaInfoMyHelp: res.data.data,
|
||||
curuid: wx.getStorageSync('uid')
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
helpKanjia: function() {
|
||||
var that = this;
|
||||
api.fetchRequest('/shop/goods/kanjia/help', {
|
||||
kjid: that.data.kjId,
|
||||
joinerUser: that.data.joiner,
|
||||
token: wx.getStorageSync('token')
|
||||
}).then(function(res) {
|
||||
if (res.data.code != 0) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
that.setData({
|
||||
mykanjiaInfo: res.data.data
|
||||
});
|
||||
wx.showModal({
|
||||
title: '成功',
|
||||
content: '成功帮好友砍掉 ' + res.data.data.cutPrice + ' 元',
|
||||
showCancel: false
|
||||
})
|
||||
that.getKanjiaInfo(that.data.kjId, that.data.joiner);
|
||||
that.getKanjiaInfoMyHelp(that.data.kjId, that.data.joiner);
|
||||
})
|
||||
},
|
||||
tobuy: function() {
|
||||
wx.navigateTo({
|
||||
url: "/pages/goods-details/index?id=" + this.data.kanjiaInfo.kanjiaInfo.goodsId + "&kjId=" + this.data.kanjiaInfo.kanjiaInfo.kjId
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "砍价详情"
|
||||
}
|
@ -1,352 +0,0 @@
|
||||
@import "/wxParse/wxParse.wxss";
|
||||
|
||||
.container {
|
||||
background-color: #F2f2f2;
|
||||
min-height: 100%;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
.swiper-container{
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.swiper_box {
|
||||
width: 100%;
|
||||
height:748rpx;
|
||||
}
|
||||
|
||||
swiper-item image {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
height:748rpx;
|
||||
}
|
||||
.swiper-container .dots{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.swiper-container .dots .dot{
|
||||
margin: 0 8rpx;
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
background: #000;
|
||||
border-radius: 50%;
|
||||
transition: all .6s;
|
||||
opacity: .3;
|
||||
}
|
||||
.swiper-container .dots .dot.active{
|
||||
opacity: .6;
|
||||
}
|
||||
.goods-info{
|
||||
background-color: #fff;
|
||||
padding: 35rpx 0;
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.goods-info-fx {
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 60px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.goods-info-fx button {
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 60px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.goods-info-fx image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
margin: 10px 10px 0 5px;
|
||||
}
|
||||
|
||||
.goods-info-fx text {
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
font-size: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
.goods-info .goods-title{
|
||||
box-sizing: border-box;
|
||||
padding: 0 35rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 1.4;
|
||||
color: #000;
|
||||
margin-bottom: 28rpx;
|
||||
padding-right: 60px;
|
||||
}
|
||||
.goods-info .goods-share{
|
||||
box-sizing: border-box;
|
||||
padding: 0 35rpx;
|
||||
font-size: 25rpx;
|
||||
line-height: 1.4;
|
||||
color: #CC0000;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
.goods-info .goods-price{
|
||||
box-sizing:border-box;
|
||||
color:#e64340;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
float:left;
|
||||
}
|
||||
.row-arrow{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 120rpx 0 35rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
height: 102rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 102rpx;
|
||||
margin-bottom: 28rpx;
|
||||
background: #fff url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 697rpx center;
|
||||
background-size: 18rpx auto;
|
||||
}
|
||||
.goods-des-info{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
.label-title{
|
||||
font-size:28rpx;
|
||||
color:#000000;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.goods-text{
|
||||
padding: 0 10rpx;
|
||||
font-size:28rpx;
|
||||
color:#666666;
|
||||
line-height: 56rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.des-imgs{
|
||||
width:100%;
|
||||
}
|
||||
.des-imgs image{
|
||||
width: 100%;
|
||||
}
|
||||
.footer-box{
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
box-shadow:0 0 8rpx 0 ;
|
||||
}
|
||||
.footer-box .contact {
|
||||
position: relative;
|
||||
width: 120rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
/*line-height: 100rpx;
|
||||
text-align: center;
|
||||
padding-top: 26rpx;*/
|
||||
font-size: 20rpx;
|
||||
color: #008000;
|
||||
box-sizing: border-box;
|
||||
background: url("https://cdn.it120.cc/images/weappshop/kefu.png") no-repeat center 21rpx;
|
||||
background-size: 55rpx auto;
|
||||
}
|
||||
.footer-box .shop-cart-btn {
|
||||
position: relative;
|
||||
width: 135rpx;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
font-size: 20rpx;
|
||||
color: #acacb7;
|
||||
box-sizing: border-box;
|
||||
background: url("https://cdn.it120.cc/images/weappshop/cart.png") no-repeat center 21rpx;
|
||||
background-size: 44rpx auto;
|
||||
}
|
||||
.footer-box .shop-cart-btn .shop-num{
|
||||
position: absolute;
|
||||
color:#e64340;
|
||||
left: 85rpx;
|
||||
top:10rpx;
|
||||
}
|
||||
.footer-box .join-shop-cart{
|
||||
text-align: center;
|
||||
width: 250rpx;
|
||||
height: 100%;
|
||||
line-height: 100rpx;
|
||||
background-color: #ff6850;
|
||||
color:#fff;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.footer-box .now-buy{
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
width: 250rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
font-size: 34rpx;
|
||||
margin-left:250rpx;
|
||||
}
|
||||
.footer-box .now-buy-no{
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
width: 750rpx;
|
||||
line-height: 100rpx;
|
||||
color:#f00;
|
||||
font-size: 34rpx;
|
||||
}
|
||||
.show-popup{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
z-index: 4;
|
||||
}
|
||||
.popup-mask{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 5;
|
||||
}
|
||||
.popup-contents{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
z-index: 6;
|
||||
}
|
||||
.pop-goods-info{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin-left: 30rpx;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.pop-img-box{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 26rpx;
|
||||
}
|
||||
.pop-img-box .goods-thumbnail{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
.pop-goods-title{
|
||||
width: 484rpx;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
}
|
||||
.pop-goods-price{
|
||||
font-size:26rpx;
|
||||
color:#e64340;
|
||||
margin-top:20rpx;
|
||||
}
|
||||
.pop-goods-close{
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
flex: 1;
|
||||
background:url("https://cdn.it120.cc/images/weappshop/popup-close.png") no-repeat center center;
|
||||
background-size: 36rpx auto;
|
||||
align-self: flex-start;
|
||||
margin-top: -10rpx;
|
||||
}
|
||||
.size-label-box .label{
|
||||
font-size:26rpx;
|
||||
color:#000;
|
||||
padding-left: 30rpx;
|
||||
padding: 30rpx 0 20rpx 30rpx;
|
||||
}
|
||||
.size-label-box .label-item-box{
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
flex-direction: row;
|
||||
flex-wrap:wrap;
|
||||
}
|
||||
.size-label-box .label-item{
|
||||
font-size:26rpx;
|
||||
color:#000;
|
||||
padding: 14rpx 20rpx;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 6rpx;
|
||||
margin: 0 20rpx 20rpx 0;
|
||||
}
|
||||
.size-label-box .label-item.active{
|
||||
color: #e64340;
|
||||
border: 1px solid #e64340;
|
||||
}
|
||||
.buy-num-box{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 30rpx 48rpx 0;
|
||||
margin-left: 30rpx;
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
.num-label{
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
}
|
||||
.buy-num-box .num-box{
|
||||
display: flex;
|
||||
}
|
||||
.buy-num-box .num-box .num-jian,
|
||||
.buy-num-box .num-box .num-input,
|
||||
.buy-num-box .num-box .num-jia{
|
||||
width: 80rpx;
|
||||
height: 64rpx;
|
||||
line-height: 62rpx;
|
||||
text-align: center;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
.buy-num-box .num-box .num-input{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.buy-num-box .num-box .num-input input{
|
||||
height: 100%;
|
||||
}
|
||||
.popup-join-btn{
|
||||
width: 100%;
|
||||
height: 89rpx;
|
||||
text-align: center;
|
||||
line-height: 89rpx;
|
||||
font-size:34rpx;
|
||||
color:#ffffff;
|
||||
background-color: #e64340;
|
||||
}
|
||||
.buy-num-box .num-box .hui{
|
||||
background-color: #f5f5f9;
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
//logs.js
|
||||
const util = require('../../utils/util.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
logs: []
|
||||
},
|
||||
onLoad: function () {
|
||||
this.setData({
|
||||
logs: (wx.getStorageSync('logs') || []).map(log => {
|
||||
return util.formatTime(new Date(log))
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "查看启动日志",
|
||||
"usingComponents": {}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<!--logs.wxml-->
|
||||
<view class="container log-list">
|
||||
<block wx:for="{{logs}}" wx:for-item="log">
|
||||
<text class="log-item">{{index + 1}}. {{log}}</text>
|
||||
</block>
|
||||
</view>
|
@ -1,8 +0,0 @@
|
||||
.log-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.log-item {
|
||||
margin: 10rpx;
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
const app = getApp()
|
||||
const api = require('../../utils/request.js')
|
||||
const CONFIG = require('../../config.js')
|
||||
Page({
|
||||
data: {
|
||||
balance:0,
|
||||
freeze:0,
|
||||
score:0,
|
||||
score_sign_continuous:0
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
let that = this;
|
||||
let userInfo = wx.getStorageSync('userInfo')
|
||||
if (!userInfo) {
|
||||
app.goLoginPageTimeOut()
|
||||
} else {
|
||||
that.setData({
|
||||
userInfo: userInfo,
|
||||
version: CONFIG.version
|
||||
})
|
||||
}
|
||||
this.getUserApiInfo();
|
||||
this.getUserAmount();
|
||||
this.checkScoreSign();
|
||||
},
|
||||
aboutUs : function () {
|
||||
wx.showModal({
|
||||
title: '关于我们',
|
||||
content: '本系统基于开源小程序商城系统 https://github.com/EastWorld/wechat-app-mall 搭建,祝大家使用愉快!',
|
||||
showCancel:false
|
||||
})
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
if (!e.detail.errMsg || e.detail.errMsg != "getPhoneNumber:ok") {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '无法获取手机号码',
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
var that = this;
|
||||
api.fetchRequest('/user/wxapp/bindMobile', {
|
||||
token: wx.getStorageSync('token'),
|
||||
encryptedData: e.detail.encryptedData,
|
||||
iv: e.detail.iv
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
wx.showToast({
|
||||
title: '绑定成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
that.getUserApiInfo();
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '绑定失败',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserApiInfo: function () {
|
||||
var that = this;
|
||||
api.fetchRequest('/user/detail', {
|
||||
token: wx.getStorageSync('token'),
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
let _data = {}
|
||||
_data.apiUserInfoMap = res.data.data
|
||||
if (res.data.data.base.mobile) {
|
||||
_data.userMobile = res.data.data.base.mobile
|
||||
}
|
||||
that.setData(_data);
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserAmount: function () {
|
||||
var that = this;
|
||||
api.fetchRequest('/user/amount', {
|
||||
token: wx.getStorageSync('token'),
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
balance: res.data.data.balance,
|
||||
freeze: res.data.data.freeze,
|
||||
score: res.data.data.score
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
checkScoreSign: function () {
|
||||
var that = this;
|
||||
api.fetchRequest('/score/today-signed', {
|
||||
token: wx.getStorageSync('token'),
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
score_sign_continuous: res.data.data.continuous
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
scoresign: function () {
|
||||
var that = this;
|
||||
api.fetchRequest('/score/sign', {
|
||||
token: wx.getStorageSync('token'),
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.getUserAmount();
|
||||
that.checkScoreSign();
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
relogin:function(){
|
||||
app.goLoginPageTimeOut()
|
||||
},
|
||||
recharge: function () {
|
||||
wx.navigateTo({
|
||||
url: "/pages/recharge/index"
|
||||
})
|
||||
},
|
||||
withdraw: function () {
|
||||
wx.navigateTo({
|
||||
url: "/pages/withdraw/index"
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<view class="container">
|
||||
<view class="userinfo">
|
||||
<image wx:if="{{userInfo && userInfo.avatarUrl}}" class="userinfo-avatar" src="{{ userInfo.avatarUrl }}" background-size="cover"></image>
|
||||
<text class="userinfo-nickname">{{ userInfo.nickName }}</text>
|
||||
</view>
|
||||
<view style="height:20rpx;background: #eee;width:100%;"></view>
|
||||
<view class="my-item" style='background:none;display:flex;flex-direction:column;height:auto;'>
|
||||
<view>
|
||||
余额 {{balance}} 元, 冻结 {{freeze}} 元
|
||||
</view>
|
||||
<view style='display:flex;padding-bottom:20rpx;'>
|
||||
<button type='primary' style='width:100%;margin-right:70rpx;' bindtap="recharge">充值</button>
|
||||
<button type='warn' style='width:100%;margin-right:70rpx;' bindtap="withdraw">提现</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-item" style='background:none;display:flex;'>
|
||||
<view>当前积分 {{score}} </view>
|
||||
<button wx:if="{{score_sign_continuous == 0}}" style='height:80rpx;margin-right:70rpx;' bindtap="scoresign">每日签到</button>
|
||||
<button wx:if="{{score_sign_continuous > 0}}" disabled='true' style='height:80rpx;margin-right:70rpx;'>已连续{{score_sign_continuous}}天签到</button>
|
||||
</view>
|
||||
<view class="my-item">
|
||||
<navigator url="/pages/score-excharge/index" hover-class="navigator-hover">积分兑换</navigator>
|
||||
</view>
|
||||
<view class="my-item">
|
||||
<navigator url="/pages/order-list/index" hover-class="navigator-hover">我的订单</navigator>
|
||||
</view>
|
||||
<view class="my-item">
|
||||
<navigator url="/pages/select-address/index" hover-class="navigator-hover">我的收货地址</navigator>
|
||||
</view>
|
||||
<view class="my-item">
|
||||
<navigator url="/pages/mycoupons/index" hover-class="navigator-hover">我的优惠券</navigator>
|
||||
</view>
|
||||
<view wx:if="{{!userMobile}}" class="my-item" style="border:none;padding-right:150rpx;width:auto;">
|
||||
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">绑定手机号码</button>
|
||||
</view>
|
||||
<view wx:if="{{userMobile}}" class="my-item" style="border:none;padding-right:150rpx;width:auto;">
|
||||
{{userMobile}}
|
||||
</view>
|
||||
<view style="height:20rpx;background: #eee;width:100%;"></view>
|
||||
<view class="about" bindtap="aboutUs">
|
||||
关于我们
|
||||
</view>
|
||||
|
||||
<view style="height:20rpx;background: #eee;width:100%;"></view>
|
||||
<view class="my-item" style="border:none;padding:0rpx;margin:0rpx;background:none;border:none;height:auto;line-height:auto;">
|
||||
<button type="warn" bindtap="relogin">重新授权登录</button>
|
||||
</view>
|
||||
|
||||
<view style="height:20rpx;background: #eee;width:100%;"></view>
|
||||
<view class="version">Powered by EastWorld v {{version}}</view>
|
||||
<view style="height:20rpx;background: #eee;width:100%;"></view>
|
||||
</view>
|
@ -1,56 +0,0 @@
|
||||
.container{
|
||||
min-height: 100%;
|
||||
overflow: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.userinfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 50rpx 0;
|
||||
align-items: center;
|
||||
background: #e85654;
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.userinfo-avatar {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.userinfo-nickname {
|
||||
margin-top: 20rpx;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
.version {
|
||||
width:100%;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.my-item{
|
||||
width: 100%;
|
||||
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 750rpx center;
|
||||
background-size: 16rpx auto,750rpx auto;
|
||||
margin: 20rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
padding-left: 100rpx;
|
||||
}
|
||||
|
||||
.about{
|
||||
width: 100%;
|
||||
background: url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 750rpx center;
|
||||
background-size: 16rpx auto,750rpx auto;
|
||||
margin: 20rpx 0;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
padding-left: 100rpx;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
//index.js
|
||||
const api = require('../../utils/request.js')
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
coupons: []
|
||||
},
|
||||
onLoad: function() {},
|
||||
onShow: function() {
|
||||
this.getMyCoupons();
|
||||
},
|
||||
getMyCoupons: function() {
|
||||
var that = this;
|
||||
api.fetchRequest('/discounts/my', {
|
||||
token: wx.getStorageSync('token'),
|
||||
status: 0
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
var coupons = res.data.data;
|
||||
if (coupons.length > 0) {
|
||||
that.setData({
|
||||
coupons: coupons
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
goBuy: function() {
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "我的优惠券"
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<view class="container">
|
||||
<view class="coupons-list">
|
||||
<view class="coupons-item" wx:for-items="{{coupons}}" wx:for-index="idx" bindtap="gitCoupon" data-id="{{item.id}}">
|
||||
<view style="font-size: 50rpx"> ¥ {{item.money}}元 </view>
|
||||
<view> {{item.name}} </view>
|
||||
<view> 满 {{item.moneyHreshold}} 元使用 </view>
|
||||
<view> {{item.dateEnd}} 前有效 </view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height:100rpx;background-color:#fff;width:100%;"></view>
|
||||
<view class="bottom-box">
|
||||
<view class="add-btn" bindtap="goBuy">立即前往下单</view>
|
||||
</view>
|
||||
|
||||
</view>
|
@ -1,36 +0,0 @@
|
||||
.container {
|
||||
background-color:#F2f2f2;
|
||||
}
|
||||
.coupons-list{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.bottom-box{
|
||||
position:fixed;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
font-size:28rpx;
|
||||
color:#000000;
|
||||
border-top: 1rpx solid #eee;
|
||||
height:100rpx;
|
||||
line-height: 100rpx;
|
||||
background: #fff url(https://cdn.it120.cc/images/weappshop/arrow-right.png) no-repeat 705rpx center;
|
||||
}
|
||||
.bottom-box .add-btn{
|
||||
margin-left: 30rpx;
|
||||
padding-left: 70rpx;
|
||||
background: url(https://cdn.it120.cc/images/weappshop/add-addr.png) no-repeat left center;
|
||||
background-size: 40rpx auto;
|
||||
}
|
||||
.coupons-item{
|
||||
width:630rpx;
|
||||
height: 180rpx;
|
||||
margin: 10rpx;
|
||||
padding: 50rpx;
|
||||
background-color: #f1a83b;
|
||||
font-size: 30rpx;
|
||||
line-height: 50rpx;
|
||||
color: #fff;
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
var app = getApp();
|
||||
var WxParse = require('../../wxParse/wxParse.js');
|
||||
const api = require('../../utils/request.js')
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var that = this;
|
||||
api.fetchRequest('/notice/detail', {
|
||||
id: options.id
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
notice: res.data.data
|
||||
});
|
||||
WxParse.wxParse('article', 'html', res.data.data.content, that, 5);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "公告详情"
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<import src="../../wxParse/wxParse.wxml" />
|
||||
|
||||
|
||||
<view class="notice">
|
||||
<view class="title">{{notice.title}}</view>
|
||||
<view class="text">
|
||||
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
|
||||
</view>
|
||||
</view>
|
@ -1,10 +0,0 @@
|
||||
.notice {
|
||||
width: 750rpx;
|
||||
padding: 15rpx;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
.title {
|
||||
color:chocolate;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
var app = getApp();
|
||||
const api = require('../../utils/request.js')
|
||||
const CONFIG = require('../../config.js')
|
||||
Page({
|
||||
data:{
|
||||
orderId:0,
|
||||
goodsList:[],
|
||||
yunPrice:"0.00",
|
||||
appid: CONFIG.appid
|
||||
},
|
||||
onLoad:function(e){
|
||||
var orderId = e.id;
|
||||
this.data.orderId = orderId;
|
||||
this.setData({
|
||||
orderId: orderId
|
||||
});
|
||||
},
|
||||
onShow : function () {
|
||||
var that = this;
|
||||
api.fetchRequest('/order/detail', {
|
||||
token: wx.getStorageSync('token'),
|
||||
id: that.data.orderId
|
||||
}).then(function (res) {
|
||||
if (res.data.code != 0) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
that.setData({
|
||||
orderDetail: res.data.data
|
||||
});
|
||||
}).finally(res => {
|
||||
wx.hideLoading();
|
||||
})
|
||||
var yunPrice = parseFloat(this.data.yunPrice);
|
||||
var allprice = 0;
|
||||
var goodsList = this.data.goodsList;
|
||||
for (var i = 0; i < goodsList.length; i++) {
|
||||
allprice += parseFloat(goodsList[0].price) * goodsList[0].number;
|
||||
}
|
||||
this.setData({
|
||||
allGoodsPrice: allprice,
|
||||
yunPrice: yunPrice
|
||||
});
|
||||
},
|
||||
wuliuDetailsTap:function(e){
|
||||
var orderId = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: "/pages/wuliu/index?id=" + orderId
|
||||
})
|
||||
},
|
||||
confirmBtnTap:function(e){
|
||||
let that = this;
|
||||
let orderId = this.data.orderId;
|
||||
let formId = e.detail.formId;
|
||||
wx.showModal({
|
||||
title: '确认您已收到商品?',
|
||||
content: '',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
wx.showLoading();
|
||||
api.fetchRequest('/order/delivery', {
|
||||
token: wx.getStorageSync('token'),
|
||||
orderId: orderId
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.onShow();
|
||||
// 模板消息,提醒用户进行评价
|
||||
let postJsonString = {};
|
||||
postJsonString.keyword1 = { value: that.data.orderDetail.orderInfo.orderNumber, color: '#173177' }
|
||||
let keywords2 = '您已确认收货,期待您的再次光临!';
|
||||
if (app.globalData.order_reputation_score) {
|
||||
keywords2 += '立即好评,系统赠送您' + app.globalData.order_reputation_score + '积分奖励。';
|
||||
}
|
||||
postJsonString.keyword2 = { value: keywords2, color: '#173177' }
|
||||
app.sendTempleMsgImmediately('uJL7D8ZWZfO29Blfq34YbuKitusY6QXxJHMuhQm_lco', formId,
|
||||
'/pages/order-details/index?id=' + orderId, JSON.stringify(postJsonString));
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
submitReputation: function (e) {
|
||||
let that = this;
|
||||
let formId = e.detail.formId;
|
||||
let postJsonString = {};
|
||||
postJsonString.token = wx.getStorageSync('token');
|
||||
postJsonString.orderId = this.data.orderId;
|
||||
let reputations = [];
|
||||
let i = 0;
|
||||
while (e.detail.value["orderGoodsId" + i]) {
|
||||
let orderGoodsId = e.detail.value["orderGoodsId" + i];
|
||||
let goodReputation = e.detail.value["goodReputation" + i];
|
||||
let goodReputationRemark = e.detail.value["goodReputationRemark" + i];
|
||||
|
||||
let reputations_json = {};
|
||||
reputations_json.id = orderGoodsId;
|
||||
reputations_json.reputation = goodReputation;
|
||||
reputations_json.remark = goodReputationRemark;
|
||||
|
||||
reputations.push(reputations_json);
|
||||
i++;
|
||||
}
|
||||
postJsonString.reputations = reputations;
|
||||
wx.showLoading();
|
||||
api.fetchRequest('/order/reputation', {
|
||||
postJsonString: postJsonString
|
||||
}).then(function (res) {
|
||||
if (res.data.code == 0) {
|
||||
that.onShow();
|
||||
// 模板消息,通知用户已评价
|
||||
let postJsonString = {};
|
||||
postJsonString.keyword1 = { value: that.data.orderDetail.orderInfo.orderNumber, color: '#173177' }
|
||||
let keywords2 = '感谢您的评价,期待您的再次光临!';
|
||||
if (app.globalData.order_reputation_score) {
|
||||
keywords2 += app.globalData.order_reputation_score + '积分奖励已发放至您的账户。';
|
||||
}
|
||||
postJsonString.keyword2 = { value: keywords2, color: '#173177' }
|
||||
app.sendTempleMsgImmediately('uJL7D8ZWZfO29Blfq34YbuKitusY6QXxJHMuhQm_lco', formId,
|
||||
'/pages/order-details/index?id=' + that.data.orderId, JSON.stringify(postJsonString));
|
||||
}
|
||||
}).finally(res => {
|
||||
wx.hideLoading();
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
@ -1,293 +0,0 @@
|
||||
page{
|
||||
min-height: 100%;
|
||||
background-color: #F2f2f2;
|
||||
}
|
||||
.container{
|
||||
min-height: 100%;
|
||||
overflow: hidden;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.sec-wrap{
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.bottom-fiexd{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
}
|
||||
.sec-wrap .order-status{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
height: 140rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.order-status .icon-box{
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.order-status .icon-box .icon{
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.order-status .right-text{
|
||||
width: 580rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.order-status .right-text .status{
|
||||
font-size:28rpx;
|
||||
color:#000;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.order-status .right-text .red{
|
||||
color:#e64340;
|
||||
}
|
||||
.order-status .right-text .des{
|
||||
font-size:24rpx;
|
||||
color:#999;
|
||||
}
|
||||
.address-sec{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.address-sec .icon-box{
|
||||
width: 30rpx;
|
||||
align-self: flex-start;
|
||||
overflow: hidden;
|
||||
margin-right: 35rpx;
|
||||
}
|
||||
.address-sec .icon-box .icon{
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.address-sec .right-box{
|
||||
width: 620rpx;
|
||||
}
|
||||
.address-sec .right-box .name-tel{
|
||||
font-size:28rpx;
|
||||
color:#000000;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.address-sec .right-box .text{
|
||||
font-size:24rpx;
|
||||
color:#888888;
|
||||
line-height:36rpx;
|
||||
height: 72rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wuliu-box{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
.wuliu-box .icon-box {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 31rpx;
|
||||
align-self: flex-start;
|
||||
}
|
||||
.wuliu-box .icon-box .icon{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.wuliu-box .arrow-right{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.wuliu-box .arrow-right .arrow{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.wuliu-box .right-text{
|
||||
width: 575rpx;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.wuliu-box .right-text .order-number{
|
||||
font-size:28rpx;
|
||||
color:#000;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
.wuliu-box .right-text .wuliu-text,
|
||||
.wuliu-box .right-text .wuliu-date{
|
||||
font-size:24rpx;
|
||||
color:#888888;
|
||||
line-height:36rpx;
|
||||
}
|
||||
|
||||
.goods-list{
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.goods-list .list-title{
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
padding: 30rpx 0 25rpx 30rpx;
|
||||
}
|
||||
.goods-list .a-goods{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
display: flex;
|
||||
/*justify-content: space-between;*/
|
||||
border-top: 1px solid #eee;
|
||||
padding: 30rpx 30rpx 30rpx 0;
|
||||
}
|
||||
.goods-list .a-goods .img-box{
|
||||
width: 160rpx;
|
||||
height:160rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx;
|
||||
background-color: #d8d8d8;
|
||||
}
|
||||
|
||||
.goods-list .img-box .img{
|
||||
width: 160rpx;
|
||||
height:160rpx;
|
||||
}
|
||||
.goods-list .a-goods .text-box{
|
||||
width: 510rpx;
|
||||
box-sizing: border-box;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
.goods-list .btn-row{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.confirm-btn{
|
||||
background:#ffffff;
|
||||
border:1rpx solid #e64340;
|
||||
border-radius:6rpx;
|
||||
width:164rpx;
|
||||
height:60rpx;
|
||||
line-height: 60rpx;
|
||||
margin: 20rpx 30rpx 20rpx auto;
|
||||
font-size:26rpx;
|
||||
color:#e64340;
|
||||
text-align:center;
|
||||
}
|
||||
.a-goods .text-box .arow{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.a-goods .text-box .arow .goods-name{
|
||||
width: 360rpx;
|
||||
font-size:26rpx;
|
||||
height: 74rpx;
|
||||
color:#000000;
|
||||
line-height: 1.6;
|
||||
overflow: hidden;
|
||||
}
|
||||
.a-goods .text-box .arow01{
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.a-goods .text-box .arow .goods-price{
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
align-self: flex-start;
|
||||
}
|
||||
.a-goods .text-box .arow .goods-label{
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
.a-goods .text-box .arow .goods-num{
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
}
|
||||
.peisong-way{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.peisong-way .row-box{
|
||||
width: 720rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
.peisong-way .row-label{
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
}
|
||||
.peisong-way .right-text{
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.peisong-way .liuyan{
|
||||
width: 510rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.goods-info{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-bottom: 120rpx;
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
.goods-info .row-box{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 24rpx 30rpx 12rpx 30rpx;
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
}
|
||||
.goods-info .row-box .right-text{
|
||||
text-align: right;
|
||||
}
|
||||
.jiesuan-box{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top:1px solid #eee;
|
||||
background-color: #fff;
|
||||
z-index: 4;
|
||||
}
|
||||
.jiesuan-box .to-pay-btn{
|
||||
width:250rpx;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
line-height: 100rpx;
|
||||
background-color: #e64340;
|
||||
font-size:32rpx;
|
||||
color:#ffffff;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.jiesuan-box .left-price{
|
||||
display: flex;
|
||||
width: 500rpx;
|
||||
justify-content:flex-end;
|
||||
line-height: 100rpx;
|
||||
padding: 0 30rpx 0 0;
|
||||
font-size:28rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.jiesuan-box .total{
|
||||
color: #e64340;
|
||||
text-align: right;
|
||||
}
|
@ -1,180 +0,0 @@
|
||||
var wxpay = require('../../utils/pay.js')
|
||||
const api = require('../../utils/request.js')
|
||||
var app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
statusType: ["待付款", "待发货", "待收货", "待评价", "已完成"],
|
||||
currentType: 0,
|
||||
tabClass: ["", "", "", "", ""]
|
||||
},
|
||||
statusTap: function(e) {
|
||||
var curType = e.currentTarget.dataset.index;
|
||||
this.data.currentType = curType
|
||||
this.setData({
|
||||
currentType: curType
|
||||
});
|
||||
this.onShow();
|
||||
},
|
||||
orderDetail: function(e) {
|
||||
var orderId = e.currentTarget.dataset.id;
|
||||
wx.navigateTo({
|
||||
url: "/pages/order-details/index?id=" + orderId
|
||||
})
|
||||
},
|
||||
cancelOrderTap: function(e) {
|
||||
var that = this;
|
||||
var orderId = e.currentTarget.dataset.id;
|
||||
wx.showModal({
|
||||
title: '确定要取消该订单吗?',
|
||||
content: '',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
wx.showLoading();
|
||||
api.fetchRequest('/order/close', {
|
||||
token: wx.getStorageSync('token'),
|
||||
orderId: orderId
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.onShow();
|
||||
}
|
||||
}).finally(function(res) {
|
||||
wx.hideLoading();
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toPayTap: function(e) {
|
||||
var that = this;
|
||||
var orderId = e.currentTarget.dataset.id;
|
||||
var money = e.currentTarget.dataset.money;
|
||||
var needScore = e.currentTarget.dataset.score;
|
||||
api.fetchRequest('/user/amount', {
|
||||
token: wx.getStorageSync('token'),
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
// res.data.data.balance
|
||||
money = money - res.data.data.balance;
|
||||
if (res.data.data.score < needScore) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '您的积分不足,无法支付',
|
||||
showCancel: false
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (money <= 0) {
|
||||
// 直接使用余额支付
|
||||
api.fetchRequest('/order/pay', {
|
||||
token: wx.getStorageSync('token'),
|
||||
orderId: orderId
|
||||
}, 'POST', 0, {
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}).then(function(res) {
|
||||
that.onShow();
|
||||
})
|
||||
} else {
|
||||
wxpay.wxpay(app, money, orderId, "/pages/order-list/index");
|
||||
}
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '无法获取用户资金信息',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onLoad: function(options) {
|
||||
// 生命周期函数--监听页面加载
|
||||
|
||||
},
|
||||
onReady: function() {
|
||||
// 生命周期函数--监听页面初次渲染完成
|
||||
|
||||
},
|
||||
getOrderStatistics: function() {
|
||||
var that = this;
|
||||
api.fetchRequest('/order/statistics', {
|
||||
token: wx.getStorageSync('token')
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
var tabClass = that.data.tabClass;
|
||||
if (res.data.data.count_id_no_pay > 0) {
|
||||
tabClass[0] = "red-dot"
|
||||
} else {
|
||||
tabClass[0] = ""
|
||||
}
|
||||
if (res.data.data.count_id_no_transfer > 0) {
|
||||
tabClass[1] = "red-dot"
|
||||
} else {
|
||||
tabClass[1] = ""
|
||||
}
|
||||
if (res.data.data.count_id_no_confirm > 0) {
|
||||
tabClass[2] = "red-dot"
|
||||
} else {
|
||||
tabClass[2] = ""
|
||||
}
|
||||
if (res.data.data.count_id_no_reputation > 0) {
|
||||
tabClass[3] = "red-dot"
|
||||
} else {
|
||||
tabClass[3] = ""
|
||||
}
|
||||
if (res.data.data.count_id_success > 0) {
|
||||
//tabClass[4] = "red-dot"
|
||||
} else {
|
||||
//tabClass[4] = ""
|
||||
}
|
||||
|
||||
that.setData({
|
||||
tabClass: tabClass,
|
||||
});
|
||||
}
|
||||
}).finally(function(res) {
|
||||
wx.hideLoading();
|
||||
})
|
||||
},
|
||||
onShow: function() {
|
||||
// 获取订单列表
|
||||
wx.showLoading();
|
||||
var that = this;
|
||||
var postData = {
|
||||
token: wx.getStorageSync('token')
|
||||
};
|
||||
postData.status = that.data.currentType;
|
||||
this.getOrderStatistics();
|
||||
api.fetchRequest('/order/list', postData).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
orderList: res.data.data.orderList,
|
||||
logisticsMap: res.data.data.logisticsMap,
|
||||
goodsMap: res.data.data.goodsMap
|
||||
});
|
||||
} else {
|
||||
that.setData({
|
||||
orderList: null,
|
||||
logisticsMap: {},
|
||||
goodsMap: {}
|
||||
});
|
||||
}
|
||||
}).finally(function(res) {
|
||||
wx.hideLoading();
|
||||
})
|
||||
},
|
||||
onHide: function() {
|
||||
// 生命周期函数--监听页面隐藏
|
||||
|
||||
},
|
||||
onUnload: function() {
|
||||
// 生命周期函数--监听页面卸载
|
||||
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
// 页面相关事件处理函数--监听用户下拉动作
|
||||
|
||||
},
|
||||
onReachBottom: function() {
|
||||
// 页面上拉触底事件的处理函数
|
||||
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText":"订单列表"
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<view class="container">
|
||||
<view class="status-box">
|
||||
<view bindtap="statusTap" class="status-label {{index == currentType ? 'active' : ''}}" wx:for-items="{{statusType}}" wx:key="{{index}}" data-index="{{index}}">
|
||||
{{item}}
|
||||
<view class="{{tabClass[index]}}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="no-order" hidden="{{orderList ? true : false}}">
|
||||
<image src="/images/no-order.png" class="no-order-img"></image>
|
||||
<view class="text">暂无订单</view>
|
||||
</view>
|
||||
<view class="order-list" hidden="{{orderList ? false : true}}">
|
||||
<view class="a-order" wx:for-items="{{orderList}}" wx:key="{{index}}">
|
||||
<view class="order-date">
|
||||
<view class="date-box">下单时间:{{item.dateAdd}}</view>
|
||||
<view class="status {{(item.status==-1 || item.status==4) ? '':'red'}}">{{item.statusStr}}</view>
|
||||
</view>
|
||||
<view class="goods-info" bindtap="orderDetail" data-id="{{item.id}}">
|
||||
<view class="goods-des">
|
||||
<view>订单号:{{item.orderNumber}} </view>
|
||||
<view wx:if="{{item.remark && item.remark != ''}}">备注: {{item.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view >
|
||||
<scroll-view class="goods-img-container" scroll-x="true">
|
||||
<view class="img-box" wx:for-items="{{goodsMap[item.id]}}" wx:key="{{index}}">
|
||||
<image src="{{item.pic}}" class="goods-img"></image>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="price-box">
|
||||
<view class="total-price" wx:if="{{item.score <= 0}}">合计:¥ {{item.amountReal}}</view>
|
||||
<view class="total-price" wx:if="{{item.score > 0}}">合计:¥ {{item.amountReal}} + {{item.score}} 积分</view>
|
||||
<view class="btn cancel-btn" hidden="{{item.status==0? false : true}}" bindtap="cancelOrderTap" data-id="{{item.id}}">取消订单</view>
|
||||
<view class="btn topay-btn" hidden="{{item.status==0? false : true}}" bindtap="toPayTap" data-id="{{item.id}}" data-money="{{item.amountReal}}" data-score="{{item.score}}">马上付款</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
@ -1,155 +0,0 @@
|
||||
.container{
|
||||
width: 100%;
|
||||
background-color: #F2f2f2;
|
||||
}
|
||||
.status-box{
|
||||
width:100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
}
|
||||
.status-box .status-label{
|
||||
width: 150rpx;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
font-size:28rpx;
|
||||
color:#353535;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
.status-box .status-label.active{
|
||||
color:#e64340;
|
||||
border-bottom: 6rpx solid #e64340;
|
||||
}
|
||||
.status-box .status-label .red-dot{
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
position: absolute;
|
||||
left: 116rpx;
|
||||
top:23rpx;
|
||||
background-color: #f43530;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.no-order{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 88rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
padding-top: 203rpx;
|
||||
background-color: #F2f2f2;
|
||||
}
|
||||
.no-order-img{
|
||||
width: 81rpx;
|
||||
height: 96rpx;
|
||||
margin-bottom: 31rpx;
|
||||
}
|
||||
.no-order .text{
|
||||
font-size:28rpx;
|
||||
color:#999999;
|
||||
text-align: center
|
||||
}
|
||||
.order-list{
|
||||
width: 100%;
|
||||
}
|
||||
.order-list .a-order{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.order-list .a-order .order-date{
|
||||
padding: 0 30rpx;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
align-items: center;
|
||||
}
|
||||
.order-list .a-order .order-date .red{
|
||||
font-size:26rpx;
|
||||
color:#e64340;
|
||||
}
|
||||
.a-order .goods-info,
|
||||
.goods-img-container{
|
||||
width: 720rpx;
|
||||
margin-left: 30rpx;
|
||||
border-top: 1rpx solid #eee;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
padding: 30rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.goods-info .img-box{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 30rpx;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.goods-info .img-box .goods-img,
|
||||
.goods-img-container .img-box .goods-img{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
}
|
||||
.goods-info .goods-des{
|
||||
width: 540rpx;
|
||||
height: 78rpx;
|
||||
line-height: 39rpx;
|
||||
font-size:26rpx;
|
||||
color:#000000;
|
||||
overflow: hidden;
|
||||
}
|
||||
.goods-img-container{
|
||||
height: 180rpx;
|
||||
box-sizing: border-box;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.goods-img-container .img-box{
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
overflow: hidden;
|
||||
margin-right: 20rpx;
|
||||
background-color: #f7f7f7;
|
||||
display: inline-block;
|
||||
}
|
||||
.order-list .a-order .price-box{
|
||||
position: relative;
|
||||
width: 720rpx;
|
||||
height: 100rpx;
|
||||
margin-left: 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 30rpx 20rpx 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size:26rpx;
|
||||
}
|
||||
.order-list .a-order .price-box .total-price{
|
||||
font-size:26rpx;
|
||||
color:#e64340;
|
||||
}
|
||||
.a-order .price-box .btn{
|
||||
width: 166rpx;
|
||||
height: 60rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
border-radius: 6rpx;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.a-order .price-box .cancel-btn{
|
||||
border: 1rpx solid #ccc;
|
||||
position: absolute;
|
||||
right: 216rpx;
|
||||
top:20rpx;
|
||||
}
|
||||
.a-order .price-box .topay-btn{
|
||||
border:1px solid #e64340;
|
||||
color: #e64340;
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
var wxpay = require('../../utils/pay.js')
|
||||
var app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
uid: undefined
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
let recharge_amount_min = app.globalData.recharge_amount_min;
|
||||
if (!recharge_amount_min) {
|
||||
recharge_amount_min = 0;
|
||||
}
|
||||
this.setData({
|
||||
uid: wx.getStorageSync('uid'),
|
||||
recharge_amount_min: recharge_amount_min
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
},
|
||||
bindCancel: function () {
|
||||
wx.navigateBack({})
|
||||
},
|
||||
bindSave: function (e) {
|
||||
var that = this;
|
||||
var amount = e.detail.value.amount;
|
||||
|
||||
if (amount == "" || amount*1 < 0) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '请填写正确的充值金额',
|
||||
showCancel: false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (amount * 1 < that.data.recharge_amount_min*1) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '单次充值金额至少' + that.data.recharge_amount_min +'元',
|
||||
showCancel: false
|
||||
})
|
||||
return
|
||||
}
|
||||
wxpay.wxpay(app, amount, 0, "/pages/my/index");
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "在线充值"
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<view class="container">
|
||||
<form bindsubmit="bindSave">
|
||||
<view class="form-box">
|
||||
<view class="row-wrap">
|
||||
<view class="label">充值金额</view>
|
||||
<view class="label-right">
|
||||
<input name="amount" class="input" type="text" placeholder="{{recharge_amount_min}}"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="warn" class="save-btn" formType="submit">立即支付</button>
|
||||
<button type="default" class="cancel-btn" bindtap="bindCancel">取消</button>
|
||||
</form>
|
||||
<view style='width:100%;padding-left:30rpx;font-size: 28rpx;margin-top:30rpx;'>您也可以直接给下面的支付宝账户转账;</view>
|
||||
<view style='width:100%;padding-left:30rpx;font-size: 28rpx;margin-top:30rpx;'>转账金额将自动进入您的账户;</view>
|
||||
<input style='width:100%;padding-left:30rpx;font-size: 28rpx;margin-top:30rpx;' class="input" type="text" value='javazj@foxmail.com'/>
|
||||
<view style='width:100%;padding-left:30rpx;font-size: 30rpx;margin-top:30rpx;color:red'>转账备注请填写: {{uid}}</view>
|
||||
</view>
|
@ -1,87 +0,0 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.container{
|
||||
background-color: #f5f5f9;
|
||||
justify-content: initial;
|
||||
}
|
||||
.form-box{
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.row-wrap{
|
||||
width: 720rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.row-wrap .label{
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.row-wrap .label-right{
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.row-wrap .label-right input{
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.row-wrap .right-box{
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.arrow-right{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.save-btn,
|
||||
.cancel-btn{
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
border-radius: 6rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.save-btn{
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
}
|
||||
button[type="default"]{
|
||||
background-color: #ffffff;
|
||||
color:#000;
|
||||
}
|
||||
.addr-details{
|
||||
height: auto;
|
||||
padding: 30rpx 0;
|
||||
margin-left:30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.addr-details .label{
|
||||
margin:auto 0 auto 0;
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.addr-details textarea{
|
||||
box-sizing: border-box;
|
||||
width: 480rpx;
|
||||
overflow: scroll;
|
||||
}
|
||||
picker {
|
||||
min-width: 20rpx;
|
||||
height: 100%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.hui{
|
||||
color: #777;
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
var wxpay = require('../../utils/pay.js')
|
||||
var app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
uid: undefined
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function() {
|
||||
|
||||
},
|
||||
bindCancel: function() {
|
||||
wx.navigateBack({})
|
||||
},
|
||||
bindSave: function(e) {
|
||||
var that = this;
|
||||
var amount = e.detail.value.amount;
|
||||
|
||||
if (amount == "") {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '请填写正确的券号',
|
||||
showCancel: false
|
||||
})
|
||||
return
|
||||
}
|
||||
api.fetchRequest('/score/exchange', {
|
||||
token: wx.getStorageSync('token'),
|
||||
number: amount
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 700) {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: '券号不正确',
|
||||
showCancel: false
|
||||
})
|
||||
return
|
||||
}
|
||||
if (res.data.code == 0) {
|
||||
wx.showModal({
|
||||
title: '成功',
|
||||
content: '恭喜您,成功兑换 ' + res.data.data.score + ' 积分',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.bindCancel();
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
wx.showModal({
|
||||
title: '错误',
|
||||
content: res.data.msg,
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "积分券兑换积分"
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<view class="container">
|
||||
<form bindsubmit="bindSave">
|
||||
<view class="form-box">
|
||||
<view class="row-wrap">
|
||||
<view class="label">券号</view>
|
||||
<view class="label-right">
|
||||
<input name="amount" class="input" type="text" placeholder="请输入券号"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="warn" class="save-btn" formType="submit">立即兑换</button>
|
||||
<button type="default" class="cancel-btn" bindtap="bindCancel">取消</button>
|
||||
</form>
|
||||
</view>
|
@ -1,87 +0,0 @@
|
||||
page{
|
||||
height: 100%;
|
||||
}
|
||||
.container{
|
||||
background-color: #f5f5f9;
|
||||
justify-content: initial;
|
||||
}
|
||||
.form-box{
|
||||
width:100%;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.row-wrap{
|
||||
width: 720rpx;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
margin-left: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
/*justify-content: space-between;*/
|
||||
}
|
||||
.row-wrap .label{
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.row-wrap .label-right{
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.row-wrap .label-right input{
|
||||
height: 100%;
|
||||
font-size: 28rpx;
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
.row-wrap .right-box{
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.arrow-right{
|
||||
width: 15rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
.save-btn,
|
||||
.cancel-btn{
|
||||
width: 690rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
margin-top:30rpx;
|
||||
border-radius: 6rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.save-btn{
|
||||
background-color: #e64340;
|
||||
color:#fff;
|
||||
}
|
||||
button[type="default"]{
|
||||
background-color: #ffffff;
|
||||
color:#000;
|
||||
}
|
||||
.addr-details{
|
||||
height: auto;
|
||||
padding: 30rpx 0;
|
||||
margin-left:30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.addr-details .label{
|
||||
margin:auto 0 auto 0;
|
||||
width: 160rpx;
|
||||
color: #000
|
||||
}
|
||||
.addr-details textarea{
|
||||
box-sizing: border-box;
|
||||
width: 480rpx;
|
||||
overflow: scroll;
|
||||
}
|
||||
picker {
|
||||
min-width: 20rpx;
|
||||
height: 100%;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.hui{
|
||||
color: #777;
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
//index.js
|
||||
const api = require('../../utils/request.js')
|
||||
//获取应用实例
|
||||
var app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
addressList: []
|
||||
},
|
||||
|
||||
selectTap: function(e) {
|
||||
var id = e.currentTarget.dataset.id;
|
||||
api.fetchRequest('/user/shipping-address/update', {
|
||||
token: wx.getStorageSync('token'),
|
||||
id: id,
|
||||
isDefault: 'true'
|
||||
}).then(function(res) {
|
||||
wx.navigateBack({})
|
||||
})
|
||||
},
|
||||
|
||||
addAddess: function() {
|
||||
wx.navigateTo({
|
||||
url: "/pages/address-add/index"
|
||||
})
|
||||
},
|
||||
|
||||
editAddess: function(e) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/address-add/index?id=" + e.currentTarget.dataset.id
|
||||
})
|
||||
},
|
||||
|
||||
onLoad: function() {
|
||||
console.log('onLoad')
|
||||
|
||||
|
||||
},
|
||||
onShow: function() {
|
||||
this.initShippingAddress();
|
||||
},
|
||||
initShippingAddress: function() {
|
||||
var that = this;
|
||||
api.fetchRequest('/user/shipping-address/list', {
|
||||
token: wx.getStorageSync('token')
|
||||
}).then(function(res) {
|
||||
if (res.data.code == 0) {
|
||||
that.setData({
|
||||
addressList: res.data.data
|
||||
});
|
||||
} else if (res.data.code == 700) {
|
||||
that.setData({
|
||||
addressList: null
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"navigationBarTitleText": "选择收货地址"
|
||||
}
|