删除github上的

master
201630126029 6 years ago
parent 147a4b84d1
commit 3ec93ac29b

@ -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,136 +0,0 @@
# 微信小程序商城
微信小程序商城,微信小程序微店,长期维护版本,欢迎大家踊跃提交贡献代码;
使用说明和常见问题,可参阅下面的说明,如还有疑问,可访问工厂官网 [https://www.it120.cc/](https://www.it120.cc/) 寻求帮助!
## 扫码体验
<p>
<img src="https://cdn.it120.cc/apifactory/2017/09/15/487409738ebb80c44eda01c46d59b20c.jpg" width="200px">
<img src="https://cdn.it120.cc/apifactory/2018/04/04/570e9a77dbc9cacda176e98a4f2778c5.jpg" width="200px">
<img src="https://cdn.it120.cc/apifactory/2018/04/01/b7b8f5a0fcfc72454ade8510ab929717.jpg" width="200px">
<img src="https://cdn.it120.cc/apifactory/2018/04/19/fbf88e05686b6d9c7c5d5476c7b798d1.jpg" width="200px">
</p>
## 接口 & 后台声明
本项目为小程序商城纯前端项目,由于人力和精力所限,本项目并未有开发配套的后台系统,而是直接使用了 [api工厂](https://www.it120.cc/) 提供的免费接口和云后台,可以完全满足本项目的所有功能需求。
## 最新功能
- [新增小程序购物单支持](https://developers.weixin.qq.com/miniprogram/introduction/widget/order/quickstart/orderlist/import.html)
## 使用说明
1、申请后台账号/获取专属域名
2、开通商城模块
<img src="https://cdn.it120.cc/apifactory/2018/11/14/b61fe6ffb2460f7e4554758b394814f5.png">
3、修改根目录下 config.js 文件
```javascript
module.exports = {
version: "5.0",
note: '优化接口调用流程',
subDomain: "tz", // 如果你的域名是: https://api.it120.cc/abcd 那么这里只要填写 abcd
appid: "wxa46b09d413fbcaff", // 您的小程序的appid购物单功能需要使用
shareProfile: '百款精品商品,总有一款适合您' // 首页转发的时候话术
}
/*
根据自己需要修改下单时候的模板消息内容设置,可增加关闭订单、收货时候模板消息提醒;
1、/pages/to-pay-order/index.js 中已添加关闭订单、商家发货后提醒消费者;
2、/pages/order-details/index.js 中已添加用户确认收货后提供用户参与评价;评价后提醒消费者好评奖励积分已到账;
3、请自行修改上面几处的模板消息ID参数为您自己的变量设置即可。
*/
```
4、[设置小程序合法服务器域名](https://www.it120.cc/info/faq/10469)
5、重启您的小程序开发工具完成
## 常见问题
- [如何修改小程序商城的标题?](https://www.it120.cc/info/wechat-app-mall/10478)
- “无法登录” / Token 无效
1. app.js 里面的 subDomain 改成你自己的,保存;
2. 登录你的小程序后台MP那个地址Request 域名处增加 api.it120.cc
3. 确保小程序后台MP那个地址 的appid工厂后台填写的 appid ,开发工具右上角 “项目详情” 打开后显示的 appid 这3个 appid 是一模一样的;
4. 开发工具上点击 “清除缓存” —> “编译”
- 登录后台发布您自己的商品
- [如何给Banner增加链接点击打开某个商品](https://www.it120.cc/info/wechat-app-mall/10477)
- 工厂后台设置 appid、secret、微信支付商户号和秘钥时候的 token 怎么填?
**不要填!**
**不要填!**
**不要填!**
**重要的事情说三遍,这个小程序用不到,是给服务号使用的,所以大家空着不要填**
- 微信支付时候,提示 50000 错误不能获取到预支付id
> 这个错误是无法获取到微信支付的预支付信息
- 可能是你没有在后台配置您的微信支付商户号和秘钥,或者配置错误
- 可能是你配置的微信支付不是当前小程序申请的(微信支付目前无法跨小程序调用)
- 确保微信开发工具上面登录的 APPID 和你在后台配置的 APPID 是同一个
- 能否帮我免费添加功能?
可以!
<img src="https://cdn.it120.cc/apifactory/2017/07/29/18ae9b8aaedcd747fc5f1c3fa8bc0fe4.png" width="300px">
1. 点击页面顶部的 Star ,关注后,项目有最新动态 github 会提醒您,不错过重要更新;
2. 点击页面顶部的 Fork 将您需要增加的功能完成 小程序 端界面的调整,然后在 github 上请求将您的代码合并到 EastWorld
3. 您的代码合并请求审核通过后,我们将会为您完善配套的后台功能;
4. 开源项目离不开您的支持和代码共享,我们一起把 EastWorld 项目长期维护下去;
- 下单的时候没有地方填写收货地址?
1. 添加一个“物流模板”,只有需要快递的商品才会提示用户填写收货地址
2. 发布商品的时候,选择刚才添加的“物流模板”
3. 重新下单,将会需要用户输入收货地址
- 后台设置appid和secret的时候提示不正确
1. 请确认您填写的appid和secret是否正确
2. 输入的时候确保没有空格(复制的时候可能会多复制了空格)
3. 在微信后台设置服务器IP地址白名单106.14.43.122
- 如何使用退款功能?
1. 后台支持针对订单指定退款多少金额;
2. 可选择退款至用户可用余额或者按照用户支付原路退还第三方或者银行卡;
3. 如果选用原路退还需要在商户号和秘钥设置的地方上传您的微信支付证书文件PK12格式文件
- 如何设置满多少包邮?
1. 后台系统设置 -- 系统参数,增加系统参数;
2. 参数名 free_shipping_for_purchases (注意不要有空格)
3. 参数值填写您希望的买满金额即可
- 如何修改或者关闭订单超过30分钟未付款自动关闭
1. 创建订单接口增加 expireMinutes 参数;
2. 代表多少分钟未支付自动关闭本订单传0不自动关闭订单
- [更多问题?](https://www.it120.cc/info/all)
## 如何升级到最新版
- 小程序程序的修改和您后台的数据是独立的,所以不用担心您会丢失数据
- 先把你开发工具下的现有版本程序备份
- 下载最新版的程序,直接覆盖您本地的程序
- 用开发工具修改域名 mall 为你自己的域名
- 开发工具里面上传代码提交微信审核
- 审核通过后,小程序后台去发布新版本即可
- 用户无需重新扫码,关闭小程序重新打开就是新版本了

@ -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;
}

@ -1,13 +0,0 @@
module.exports = {
version: "5.0",
note: '优化接口调用流程',
subDomain: "6b767a23e032e73d228dd0cc31cfdc38", // 如果你的域名是: https://api.it120.cc/abcd 那么这里只要填写 abcd
appid: "wxdc9f23490d56599c", // 您的小程序的appid购物单功能需要使用
shareProfile: '百款精品商品,总有一款适合您' // 首页转发的时候话术
}
/*
根据自己需要修改下单时候的模板消息内容设置可增加关闭订单收货时候模板消息提醒
1/pages/to-pay-order/index.js 中已添加关闭订单商家发货后提醒消费者
2/pages/order-details/index.js 中已添加用户确认收货后提供用户参与评价评价后提醒消费者好评奖励积分已到账
3请自行修改上面几处的模板消息ID参数为您自己的变量设置即可
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

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,7 +0,0 @@
<view class="container">
<form bindsubmit="bindSave">
<view style='width:100%;padding-left:30rpx;font-size: 28rpx;margin-top:30rpx;'>1、同意当前小程序获取我的微信头像</view>
<view style='width:100%;padding-left:30rpx;font-size: 28rpx;margin-top:30rpx;'>2、同意当前小程序获取我的微信昵称等其他信息</view>
<button open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo" class="save-btn">授权登录</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,530 +0,0 @@
//index.js
const api = require('../../utils/request.js')
//获取应用实例
var app = getApp();
var WxParse = require('../../wxParse/wxParse.js');
Page({
data: {
autoplay: true,
interval: 3000,
duration: 1000,
goodsDetail: {},
swiperCurrent: 0,
hasMoreSelect: false,
selectSize: "选择:",
selectSizePrice: 0,
totalScoreToPay: 0,
shopNum: 0,
hideShopPopup: true,
buyNumber: 0,
buyNumMin: 1,
buyNumMax: 0,
propertyChildIds: "",
propertyChildNames: "",
canSubmit: false, // 选中规格尺寸时候是否允许加入购物车
shopCarInfo: {},
shopType: "addShopCar", //购物类型,加入购物车或立即购买,默认为加入购物车
},
//事件处理函数
swiperchange: function(e) {
//console.log(e.detail.current)
this.setData({
swiperCurrent: e.detail.current
})
},
onLoad: function(e) {
if (e.inviter_id) {
wx.setStorage({
key: 'inviter_id_' + e.id,
data: e.inviter_id
})
wx.setStorage({
key: 'referrer',
data: e.inviter_id
})
}
var that = this;
that.data.kjId = e.kjId;
// 获取购物车数据
wx.getStorage({
key: 'shopCarInfo',
success: function(res) {
that.setData({
shopCarInfo: res.data,
shopNum: res.data.shopNum
});
}
})
api.fetchRequest('/shop/goods/detail', {
id: e.id
}).then(function(res) {
var selectSizeTemp = "";
if (res.data.data.properties) {
for (var i = 0; i < res.data.data.properties.length; i++) {
selectSizeTemp = selectSizeTemp + " " + res.data.data.properties[i].name;
}
that.setData({
hasMoreSelect: true,
selectSize: that.data.selectSize + selectSizeTemp,
selectSizePrice: res.data.data.basicInfo.minPrice,
totalScoreToPay: res.data.data.basicInfo.minScore
});
}
if (res.data.data.basicInfo.pingtuan) {
that.pingtuanList(e.id)
}
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,
selectSizePrice: res.data.data.basicInfo.minPrice,
totalScoreToPay: res.data.data.basicInfo.minScore,
buyNumMax: res.data.data.basicInfo.stores,
buyNumber: (res.data.data.basicInfo.stores > 0) ? 1 : 0
});
WxParse.wxParse('article', 'html', res.data.data.content, that, 5);
})
this.reputation(e.id);
this.getKanjiaInfo(e.id);
},
goShopCar: function() {
wx.reLaunch({
url: "/pages/shop-cart/index"
});
},
toAddShopCar: function() {
this.setData({
shopType: "addShopCar"
})
this.bindGuiGeTap();
},
tobuy: function() {
this.setData({
shopType: "tobuy",
selectSizePrice: this.data.goodsDetail.basicInfo.minPrice
});
this.bindGuiGeTap();
},
toPingtuan: function(e) {
let pingtuanopenid = 0
if (e.currentTarget.dataset.pingtuanopenid) {
pingtuanopenid = e.currentTarget.dataset.pingtuanopenid
}
this.setData({
shopType: "toPingtuan",
selectSizePrice: this.data.goodsDetail.basicInfo.pingtuanPrice,
pingtuanopenid: pingtuanopenid
});
this.bindGuiGeTap();
},
/**
* 规格选择弹出框
*/
bindGuiGeTap: function() {
this.setData({
hideShopPopup: false
})
},
/**
* 规格选择弹出框隐藏
*/
closePopupTap: function() {
this.setData({
hideShopPopup: true
})
},
numJianTap: function() {
if (this.data.buyNumber > this.data.buyNumMin) {
var currentNum = this.data.buyNumber;
currentNum--;
this.setData({
buyNumber: currentNum
})
}
},
numJiaTap: function() {
if (this.data.buyNumber < this.data.buyNumMax) {
var currentNum = this.data.buyNumber;
currentNum++;
this.setData({
buyNumber: currentNum
})
}
},
/**
* 选择商品规格
* @param {Object} e
*/
labelItemTap: function(e) {
var that = this;
/*
console.log(e)
console.log(e.currentTarget.dataset.propertyid)
console.log(e.currentTarget.dataset.propertyname)
console.log(e.currentTarget.dataset.propertychildid)
console.log(e.currentTarget.dataset.propertychildname)
*/
// 取消该分类下的子栏目所有的选中状态
var childs = that.data.goodsDetail.properties[e.currentTarget.dataset.propertyindex].childsCurGoods;
for (var i = 0; i < childs.length; i++) {
that.data.goodsDetail.properties[e.currentTarget.dataset.propertyindex].childsCurGoods[i].active = false;
}
// 设置当前选中状态
that.data.goodsDetail.properties[e.currentTarget.dataset.propertyindex].childsCurGoods[e.currentTarget.dataset.propertychildindex].active = true;
// 获取所有的选中规格尺寸数据
var needSelectNum = that.data.goodsDetail.properties.length;
var curSelectNum = 0;
var propertyChildIds = "";
var propertyChildNames = "";
for (var i = 0; i < that.data.goodsDetail.properties.length; i++) {
childs = that.data.goodsDetail.properties[i].childsCurGoods;
for (var j = 0; j < childs.length; j++) {
if (childs[j].active) {
curSelectNum++;
propertyChildIds = propertyChildIds + that.data.goodsDetail.properties[i].id + ":" + childs[j].id + ",";
propertyChildNames = propertyChildNames + that.data.goodsDetail.properties[i].name + ":" + childs[j].name + " ";
}
}
}
var canSubmit = false;
if (needSelectNum == curSelectNum) {
canSubmit = true;
}
// 计算当前价格
if (canSubmit) {
api.fetchRequest('/shop/goods/price', {
goodsId: that.data.goodsDetail.basicInfo.id,
propertyChildIds: propertyChildIds
}).then(function(res) {
that.setData({
selectSizePrice: res.data.data.price,
totalScoreToPay: res.data.data.score,
propertyChildIds: propertyChildIds,
propertyChildNames: propertyChildNames,
buyNumMax: res.data.data.stores,
buyNumber: (res.data.data.stores > 0) ? 1 : 0
});
})
}
this.setData({
goodsDetail: that.data.goodsDetail,
canSubmit: canSubmit
})
},
/**
* 加入购物车
*/
addShopCar: function() {
if (this.data.goodsDetail.properties && !this.data.canSubmit) {
if (!this.data.canSubmit) {
wx.showModal({
title: '提示',
content: '请选择商品规格!',
showCancel: false
})
}
this.bindGuiGeTap();
return;
}
if (this.data.buyNumber < 1) {
wx.showModal({
title: '提示',
content: '购买数量不能为0',
showCancel: false
})
return;
}
//组建购物车
var shopCarInfo = this.bulidShopCarInfo();
this.setData({
shopCarInfo: shopCarInfo,
shopNum: shopCarInfo.shopNum
});
// 写入本地存储
wx.setStorage({
key: 'shopCarInfo',
data: shopCarInfo
})
this.closePopupTap();
wx.showToast({
title: '加入购物车成功',
icon: 'success',
duration: 2000
})
//console.log(shopCarInfo);
//shopCarInfo = {shopNum:12,shopList:[]}
},
/**
* 立即购买
*/
buyNow: function(e) {
let that = this
let shoptype = e.currentTarget.dataset.shoptype
console.log(shoptype)
if (this.data.goodsDetail.properties && !this.data.canSubmit) {
if (!this.data.canSubmit) {
wx.showModal({
title: '提示',
content: '请选择商品规格!',
showCancel: false
})
}
this.bindGuiGeTap();
wx.showModal({
title: '提示',
content: '请先选择规格尺寸哦~',
showCancel: false
})
return;
}
if (this.data.buyNumber < 1) {
wx.showModal({
title: '提示',
content: '购买数量不能为0',
showCancel: false
})
return;
}
//组建立即购买信息
var buyNowInfo = this.buliduBuyNowInfo(shoptype);
// 写入本地存储
wx.setStorage({
key: "buyNowInfo",
data: buyNowInfo
})
this.closePopupTap();
if (shoptype == 'toPingtuan') {
if (this.data.pingtuanopenid) {
wx.navigateTo({
url: "/pages/to-pay-order/index?orderType=buyNow&pingtuanOpenId=" + this.data.pingtuanopenid
})
} else {
api.fetchRequest('/shop/goods/pingtuan/open', {
token: wx.getStorageSync('token'),
goodsId: that.data.goodsDetail.basicInfo.id
}).then(function(res) {
if (res.data.code != 0) {
wx.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
})
return
}
wx.navigateTo({
url: "/pages/to-pay-order/index?orderType=buyNow&pingtuanOpenId=" + res.data.data.id
})
})
}
} else {
wx.navigateTo({
url: "/pages/to-pay-order/index?orderType=buyNow"
})
}
},
/**
* 组建购物车信息
*/
bulidShopCarInfo: function() {
// 加入购物车
var shopCarMap = {};
shopCarMap.goodsId = this.data.goodsDetail.basicInfo.id;
shopCarMap.pic = this.data.goodsDetail.basicInfo.pic;
shopCarMap.name = this.data.goodsDetail.basicInfo.name;
// shopCarMap.label=this.data.goodsDetail.basicInfo.id; 规格尺寸
shopCarMap.propertyChildIds = this.data.propertyChildIds;
shopCarMap.label = this.data.propertyChildNames;
shopCarMap.price = this.data.selectSizePrice;
shopCarMap.score = this.data.totalScoreToPay;
shopCarMap.left = "";
shopCarMap.active = true;
shopCarMap.number = this.data.buyNumber;
shopCarMap.logisticsType = this.data.goodsDetail.basicInfo.logisticsId;
shopCarMap.logistics = this.data.goodsDetail.logistics;
shopCarMap.weight = this.data.goodsDetail.basicInfo.weight;
var shopCarInfo = this.data.shopCarInfo;
if (!shopCarInfo.shopNum) {
shopCarInfo.shopNum = 0;
}
if (!shopCarInfo.shopList) {
shopCarInfo.shopList = [];
}
var hasSameGoodsIndex = -1;
for (var i = 0; i < shopCarInfo.shopList.length; i++) {
var tmpShopCarMap = shopCarInfo.shopList[i];
if (tmpShopCarMap.goodsId == shopCarMap.goodsId && tmpShopCarMap.propertyChildIds == shopCarMap.propertyChildIds) {
hasSameGoodsIndex = i;
shopCarMap.number = shopCarMap.number + tmpShopCarMap.number;
break;
}
}
shopCarInfo.shopNum = shopCarInfo.shopNum + this.data.buyNumber;
if (hasSameGoodsIndex > -1) {
shopCarInfo.shopList.splice(hasSameGoodsIndex, 1, shopCarMap);
} else {
shopCarInfo.shopList.push(shopCarMap);
}
shopCarInfo.kjId = this.data.kjId;
return shopCarInfo;
},
/**
* 组建立即购买信息
*/
buliduBuyNowInfo: function(shoptype) {
var shopCarMap = {};
shopCarMap.goodsId = this.data.goodsDetail.basicInfo.id;
shopCarMap.pic = this.data.goodsDetail.basicInfo.pic;
shopCarMap.name = this.data.goodsDetail.basicInfo.name;
// shopCarMap.label=this.data.goodsDetail.basicInfo.id; 规格尺寸
shopCarMap.propertyChildIds = this.data.propertyChildIds;
shopCarMap.label = this.data.propertyChildNames;
shopCarMap.price = this.data.selectSizePrice;
if (shoptype == 'toPingtuan') {
shopCarMap.price = this.data.goodsDetail.basicInfo.pingtuanPrice;
}
shopCarMap.score = this.data.totalScoreToPay;
shopCarMap.left = "";
shopCarMap.active = true;
shopCarMap.number = this.data.buyNumber;
shopCarMap.logisticsType = this.data.goodsDetail.basicInfo.logisticsId;
shopCarMap.logistics = this.data.goodsDetail.logistics;
shopCarMap.weight = this.data.goodsDetail.basicInfo.weight;
var buyNowInfo = {};
if (!buyNowInfo.shopNum) {
buyNowInfo.shopNum = 0;
}
if (!buyNowInfo.shopList) {
buyNowInfo.shopList = [];
}
/* var hasSameGoodsIndex = -1;
for (var i = 0; i < toBuyInfo.shopList.length; i++) {
var tmpShopCarMap = toBuyInfo.shopList[i];
if (tmpShopCarMap.goodsId == shopCarMap.goodsId && tmpShopCarMap.propertyChildIds == shopCarMap.propertyChildIds) {
hasSameGoodsIndex = i;
shopCarMap.number = shopCarMap.number + tmpShopCarMap.number;
break;
}
}
toBuyInfo.shopNum = toBuyInfo.shopNum + this.data.buyNumber;
if (hasSameGoodsIndex > -1) {
toBuyInfo.shopList.splice(hasSameGoodsIndex, 1, shopCarMap);
} else {
toBuyInfo.shopList.push(shopCarMap);
}*/
buyNowInfo.shopList.push(shopCarMap);
buyNowInfo.kjId = this.data.kjId;
return buyNowInfo;
},
onShareAppMessage: function() {
return {
title: this.data.goodsDetail.basicInfo.name,
path: '/pages/goods-details/index?id=' + this.data.goodsDetail.basicInfo.id + '&inviter_id=' + wx.getStorageSync('uid'),
success: function(res) {
// 转发成功
},
fail: function(res) {
// 转发失败
}
}
},
reputation: function(goodsId) {
var that = this;
api.fetchRequest('/shop/goods/reputation', {
goodsId: goodsId
}).then(function(res) {
if (res.data.code == 0) {
that.setData({
reputation: res.data.data
});
}
})
},
pingtuanList: function(goodsId) {
var that = this;
api.fetchRequest('/shop/goods/pingtuan/list', {
goodsId: goodsId
}).then(function(res) {
if (res.data.code == 0) {
that.setData({
pingtuanList: res.data.data
});
}
})
},
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(gid) {
var that = this;
if (!app.globalData.kanjiaList || app.globalData.kanjiaList.length == 0) {
that.setData({
curGoodsKanjia: null
});
return;
}
let curGoodsKanjia = app.globalData.kanjiaList.find(ele => {
return ele.goodsId == gid
});
if (curGoodsKanjia) {
that.setData({
curGoodsKanjia: curGoodsKanjia
});
} else {
that.setData({
curGoodsKanjia: null
});
}
},
goKanjia: function() {
var that = this;
if (!that.data.curGoodsKanjia) {
return;
}
api.fetchRequest('/shop/goods/kanjia/join', {
kjid: that.data.curGoodsKanjia.id,
token: wx.getStorageSync('token')
}).then(function(res) {
if (res.data.code == 0) {
wx.navigateTo({
url: "/pages/kanjia/index?kjId=" + res.data.data.kjId + "&joiner=" + res.data.data.uid + "&id=" + res.data.data.goodsId
})
} else {
wx.showModal({
title: '错误',
content: res.data.msg,
showCancel: false
})
}
})
},
joinPingtuan: function(e) {
let pingtuanopenid = e.currentTarget.dataset.pingtuanopenid
wx.navigateTo({
url: "/pages/to-pay-order/index?orderType=buyNow&pingtuanOpenId=" + pingtuanopenid
})
}
})

@ -1,3 +0,0 @@
{
"navigationBarTitleText": "商品详情"
}

@ -1,128 +0,0 @@
<import src="../../wxParse/wxParse.wxml" />
<view class="container">
<view class="swiper-container" wx:if="{{!goodsDetail.basicInfo.videoId}}">
<swiper class="swiper_box"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{goodsDetail.pics}}" wx:key="id">
<swiper-item>
<image src="{{item.pic}}_m" class="slide-image" width="355" height="150" mode="aspectFit" lazy-load="true"/>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{goodsDetail.pics}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
</block>
</view>
</view>
<view class="swiper-container" wx:if="{{goodsDetail.basicInfo.videoId}}">
<video src="{{videoMp4Src}}" autoplay="true" loop="true" style='width:100%'></video>
</view>
<view class="goods-info">
<view class="goods-title">{{goodsDetail.basicInfo.name}}</view>
<view class="goods-share" wx:if="{{goodsDetail.basicInfo.commissionType == 1}}">分享有赏,好友下单后可得 {{goodsDetail.basicInfo.commission}} 积分奖励</view>
<view class="goods-share" wx:if="{{goodsDetail.basicInfo.commissionType == 2}}">分享有赏,好友下单后可得 {{goodsDetail.basicInfo.commission}}元 现金奖励</view>
<view class="goods-price" style="padding-left:35rpx;">¥ {{selectSizePrice}}</view>
<view class="goods-price" style="color:#999;font-size:24rpx;">购买{{goodsDetail.basicInfo.numberOrders}}次</view>
<view class="goods-price" style="color:#999;font-size:24rpx;">共收到 {{goodsDetail.basicInfo.numberGoodReputation}} 次好评</view>
<view class="goods-info-fx">
<image src='../../images/qd.png' />
<button open-type="share">分享</button>
<text>分享有赏</text>
</view>
</view>
<view wx:if="{{curGoodsKanjia}}" class="row-arrow" bindtap="goKanjia">
邀请好友帮忙砍价 ( <text style='color:red'>底价 {{curGoodsKanjia.minPrice}} 元</text> )
</view>
<view class="goods-des-info" style="margin-top:35rpx;" wx:if="{{pingtuanList}}">
<view class="label-title" style="border-bottom:1px solid #eee;">{{pingtuanList.length}}人在拼单,可直接参与</view>
<view class="goods-text" style="margin-top:15rpx;border-bottom:1px solid #eee;" wx:for="{{pingtuanList}}" wx:key="id">
<view style="width:150rpx;float:left;">
<image style="width: 150rpx; height: 150rpx;" src="{{item.apiExtUser.avatarUrl}}"></image>
<view style="width:150rpx;text-align:center;">{{item.apiExtUser.nick}}</view>
</view>
<view style="width:500rpx;float:left;margin-left:35rpx;">
<view>已有<text style="color:red"> {{item.helpNumber}} </text>人参与</view>
<view style="color: #B0B0B0;font-size:24rpx;">截止: {{item.dateEnd}}</view>
<button type="warn" size="mini" data-pingtuanopenid="{{item.id}}" bindtap="toPingtuan"> 去拼单 </button>
</view>
</view>
</view>
<view wx:if="{{hasMoreSelect}}" class="row-arrow" bindtap="bindGuiGeTap">
{{selectSize}}
</view>
<view class="goods-des-info">
<view class="label-title">商品介绍</view>
<view class="goods-text">
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
</view>
</view>
<view class="goods-des-info" style="margin-top:35rpx;" wx:if="{{reputation}}">
<view class="label-title" style="border-bottom:1px solid #eee;">大家评价<text style="color:red">{{reputation.length}}</text></view>
<view class="goods-text" style="margin-top:15rpx;" wx:for="{{reputation}}" wx:key="id">
<view style="width:100rpx;float:left;">
<image style="width: 100rpx; height: 100rpx;" src="{{item.user.avatarUrl}}"></image>
<view style="text-align:center;width:100rpx;">{{item.goods.goodReputationStr}}</view>
</view>
<view style="width:550rpx;float:left;margin-left:35rpx;border-bottom:1px solid #eee;">
<view>{{item.goods.goodReputationRemark}}</view>
<view style="color: #B0B0B0;font-size:24rpx;">{{item.goods.dateReputation}} {{item.goods.property}}</view>
</view>
</view>
</view>
<view class="footer-box">
<view class="contact">
<contact-button style="opacity:0;position:absolute;" type="default-dark" session-from="weapp" size="27"></contact-button>
<view style='position:absolute;bottom:10rpx;'> 客服 </view>
</view>
<view class="shop-cart-btn" bindtap="goShopCar">
<view class="shop-num">({{shopNum}})</view>
<view style='position:absolute;bottom:10rpx;'> 购物车 </view>
</view>
<view wx:if="{{!goodsDetail.basicInfo.pingtuan}}" class="join-shop-cart" bindtap="toAddShopCar">加入购物车</view>
<view wx:if="{{!goodsDetail.basicInfo.pingtuan}}" class="now-buy" bindtap="tobuy">立即购买</view>
<view wx:if="{{goodsDetail.basicInfo.pingtuan}}" class="join-shop-cart" bindtap="tobuy">单独购买</view>
<view wx:if="{{goodsDetail.basicInfo.pingtuan}}" class="now-buy" bindtap="toPingtuan">发起拼团</view>
</view>
<view class="show-popup" hidden="{{hideShopPopup}}" catchtouchmove="true">
<view class="popup-mask" bindtap="closePopupTap"></view>
<view class="popup-contents">
<view class="pop-goods-info">
<view class="pop-img-box">
<image src="{{goodsDetail.basicInfo.pic}}" class="goods-thumbnail"/>
</view>
<view class="pop-goods-des">
<view class="pop-goods-title">{{goodsDetail.basicInfo.name}}</view>
<view class="pop-goods-price">¥ {{selectSizePrice}}</view>
</view>
<view class="pop-goods-close" bindtap="closePopupTap"></view>
</view>
<view class="size-label-box">
<block wx:for="{{goodsDetail.properties}}" wx:for-item="property" wx:for-index="idx" wx:key="id">
<view class="label">{{property.name}}</view>
<view class="label-item-box">
<view class="label-item {{item.active ? 'active' : '' }}" wx:for="{{property.childsCurGoods}}" wx:key="id" bindtap="labelItemTap" data-propertyindex="{{idx}}" data-propertyid="{{property.id}}" data-propertyname="{{property.name}}" data-propertychildindex="{{index}}" data-propertychildid="{{item.id}}" data-propertychildname="{{item.name}}">
{{item.name}}
</view>
</view>
</block>
</view>
<view class="buy-num-box">
<view class="num-label">购买数量</view>
<view class="num-box">
<view class="num-jian {{buyNumber == buyNumMin ? 'hui': ''}}" bindtap="numJianTap">-</view>
<view class="num-input">
<input type="number" value="{{buyNumber}}" disabled/>
</view>
<view class="num-jia {{buyNumber== buyNumMax ? 'hui': ''}}" bindtap="numJiaTap">+</view>
</view>
</view>
<view class="popup-join-btn" wx:if="{{shopType =='addShopCar'}}" bindtap="addShopCar">
加入购物车
</view>
<view class="popup-join-btn" data-shopType="{{shopType}}" wx:if="{{shopType =='tobuy' || shopType =='toPingtuan'}}" bindtap="buyNow">
立即购买
</view>
</view>
</view>
</view>

@ -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,264 +0,0 @@
//index.js
const api = require('../../utils/request.js')
const CONFIG = require('../../config.js')
//获取应用实例
var app = getApp()
Page({
data: {
indicatorDots: true,
autoplay: true,
interval: 3000,
duration: 1000,
loadingHidden: false, // loading
userInfo: {},
swiperCurrent: 0,
selectCurrent: 0,
categories: [],
activeCategoryId: 0,
goods: [],
scrollTop: 0,
loadingMoreHidden: true,
hasNoCoupons: true,
coupons: [],
searchInput: '',
curPage: 1,
pageSize: 20
},
tabClick: function(e) {
this.setData({
activeCategoryId: e.currentTarget.id,
curPage: 1
});
this.getGoodsList(this.data.activeCategoryId);
},
//事件处理函数
swiperchange: function(e) {
//console.log(e.detail.current)
this.setData({
swiperCurrent: e.detail.current
})
},
toDetailsTap: function(e) {
wx.navigateTo({
url: "/pages/goods-details/index?id=" + e.currentTarget.dataset.id
})
},
tapBanner: function(e) {
if (e.currentTarget.dataset.id != 0) {
wx.navigateTo({
url: "/pages/goods-details/index?id=" + e.currentTarget.dataset.id
})
}
},
bindTypeTap: function(e) {
this.setData({
selectCurrent: e.index
})
},
onLoad: function() {
var that = this
wx.setNavigationBarTitle({
title: wx.getStorageSync('mallName')
})
/**
* 示例
* 调用接口封装方法
*/
api.fetchRequest('/banner/list', {
key: 'mallName'
}).then(function(res) {
if (res.data.code == 404) {
wx.showModal({
title: '提示',
content: '请在后台添加 banner 轮播图片',
showCancel: false
})
} else {
that.setData({
banners: res.data.data
});
}
}).catch(function(res) {
wx.showToast({
title: res.data.msg,
icon: 'none'
})
})
api.fetchRequest('/shop/goods/category/all').then(function(res) {
var categories = [{
id: 0,
name: "全部"
}];
if (res.data.code == 0) {
for (var i = 0; i < res.data.data.length; i++) {
categories.push(res.data.data[i]);
}
}
that.setData({
categories: categories,
activeCategoryId: 0,
curPage: 1
});
that.getGoodsList(0);
})
that.getCoupons();
that.getNotice();
},
onPageScroll(e) {
let scrollTop = this.data.scrollTop
this.setData({
scrollTop: e.scrollTop
})
},
getGoodsList: function(categoryId, append) {
if (categoryId == 0) {
categoryId = "";
}
var that = this;
wx.showLoading({
"mask": true
})
api.fetchRequest('/shop/goods/list', {
categoryId: categoryId,
nameLike: that.data.searchInput,
page: this.data.curPage,
pageSize: this.data.pageSize
}).then(function(res) {
wx.hideLoading()
if (res.data.code == 404 || res.data.code == 700) {
let newData = {
loadingMoreHidden: false
}
if (!append) {
newData.goods = []
}
that.setData(newData);
return
}
let goods = [];
if (append) {
goods = that.data.goods
}
for (var i = 0; i < res.data.data.length; i++) {
goods.push(res.data.data[i]);
}
that.setData({
loadingMoreHidden: true,
goods: goods,
});
})
},
getCoupons: function() {
var that = this;
api.fetchRequest('/discounts/coupons').then(function (res) {
if (res.data.code == 0) {
that.setData({
hasNoCoupons: false,
coupons: res.data.data
});
}
})
},
gitCoupon: function(e) {
var that = this;
api.fetchRequest('/discounts/fetch', {
id: e.currentTarget.dataset.id,
token: wx.getStorageSync('token')
}).then(function (res) {
if (res.data.code == 20001 || res.data.code == 20002) {
wx.showModal({
title: '错误',
content: '来晚了',
showCancel: false
})
return;
}
if (res.data.code == 20003) {
wx.showModal({
title: '错误',
content: '你领过了,别贪心哦~',
showCancel: false
})
return;
}
if (res.data.code == 30001) {
wx.showModal({
title: '错误',
content: '您的积分不足',
showCancel: false
})
return;
}
if (res.data.code == 20004) {
wx.showModal({
title: '错误',
content: '已过期~',
showCancel: false
})
return;
}
if (res.data.code == 0) {
wx.showToast({
title: '领取成功,赶紧去下单吧~',
icon: 'success',
duration: 2000
})
} else {
wx.showModal({
title: '错误',
content: res.data.msg,
showCancel: false
})
}
})
},
onShareAppMessage: function() {
return {
title: wx.getStorageSync('mallName') + '——' + CONFIG.shareProfile,
path: '/pages/index/index',
success: function(res) {
// 转发成功
},
fail: function(res) {
// 转发失败
}
}
},
getNotice: function() {
var that = this;
api.fetchRequest('/notice/list', {pageSize: 5}).then(function (res) {
if (res.data.code == 0) {
that.setData({
noticeList: res.data.data
});
}
})
},
listenerSearchInput: function(e) {
this.setData({
searchInput: e.detail.value
})
},
toSearch: function() {
this.setData({
curPage: 1
});
this.getGoodsList(this.data.activeCategoryId);
},
onReachBottom: function() {
this.setData({
curPage: this.data.curPage + 1
});
this.getGoodsList(this.data.activeCategoryId, true)
},
onPullDownRefresh: function() {
this.setData({
curPage: 1
});
this.getGoodsList(this.data.activeCategoryId)
}
})

@ -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,52 +0,0 @@
<import src="../../wxParse/wxParse.wxml" />
<view class="container">
<view class="swiper-container" wx:if="{{!goodsDetail.basicInfo.videoId}}">
<swiper class="swiper_box"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" bindchange="swiperchange">
<block wx:for="{{goodsDetail.pics}}" wx:key="id">
<swiper-item>
<image src="{{item.pic}}_m" class="slide-image" width="355" height="150" mode="aspectFit" lazy-load="true"/>
</swiper-item>
</block>
</swiper>
<view class="dots">
<block wx:for="{{goodsDetail.pics}}" wx:key="unique">
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view>
</block>
</view>
</view>
<view class="swiper-container" wx:if="{{goodsDetail.basicInfo.videoId}}">
<video src="{{videoMp4Src}}" autoplay="true" loop="true" style='width:100%'></video>
</view>
<view class="goods-info">
<view class="goods-title">{{goodsDetail.basicInfo.name}}</view>
<view class="goods-price" style="padding-left:35rpx;">当前价格: ¥ {{kanjiaInfo.kanjiaInfo.curPrice}} , 底价 ¥ {{kanjiaInfo.kanjiaInfo.minPrice}} </view>
<view class="goods-price" style="color:#999;font-size:24rpx;padding-left:10rpx;"> (转发帮 {{kanjiaInfo.joiner.nick}} 砍价) </view>
</view>
<view class="goods-des-info">
<view class="label-title">商品介绍</view>
<view class="goods-text">
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
</view>
</view>
<view class="goods-des-info" style="margin-top:35rpx;" wx:if="{{kanjiaInfo.helps}}">
<view class="label-title" style="border-bottom:1px solid #eee;">砍价记录<text style="color:red">{{kanjiaInfo.kanjiaInfo.helpNumber}}</text></view>
<view class="goods-text" style="margin-top:15rpx;" wx:for="{{kanjiaInfo.helps}}" wx:key="id">
<view style="width:100rpx;float:left;">
<image style="width: 100rpx; height: 100rpx;" src="{{item.avatarUrl}}"></image>
<view style="text-align:center;width:100rpx;"> </view>
</view>
<view style="width:550rpx;float:left;margin-left:35rpx;border-bottom:1px solid #eee;">
<view>{{item.nick}} 帮忙砍掉 <text style="color: red">{{item.cutPrice}}</text> 元</view>
<view style="color: #B0B0B0;font-size:24rpx;">{{item.dateAdd}}</view>
</view>
</view>
</view>
<view class="footer-box">
<view class="now-buy" bindtap="helpKanjia" wx:if="{{!kanjiaInfoMyHelp}}">帮忙砍一刀</view>
<view class="now-buy-no" wx:if="{{kanjiaInfoMyHelp && kanjiaInfo&& kanjiaInfo.kanjiaInfo.uid != curuid}}">您已砍 {{kanjiaInfoMyHelp.cutPrice}} 元</view>
<view class="now-buy-no" wx:if="{{kanjiaInfoMyHelp && kanjiaInfo&& kanjiaInfo.kanjiaInfo.uid == curuid}}">
<view class="now-buy" bindtap="tobuy" style='margin-left:0;width:750rpx;'>以当前价购买</view>
</view>
</view>
</view>

@ -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,127 +0,0 @@
<view class="container">
<view class="sec-wrap">
<view class="order-status">
<view class="icon-box">
<image wx:if="{{orderDetail.orderInfo.status==-1}}" class="icon" src="/images/order-details/icon-ddgb.png"></image>
<image wx:elif="{{orderDetail.orderInfo.status==0}}" class="icon" src="/images/order-details/icon-ddfk.png"></image>
<image wx:elif="{{orderDetail.orderInfo.status==1}}" class="icon" src="/images/order-details/icon-ddfh.png"></image>
<image wx:elif="{{orderDetail.orderInfo.status==2}}" class="icon" src="/images/order-details/icon-ddsh.png"></image>
<image wx:elif="{{orderDetail.orderInfo.status==3 || orderDetail.orderInfo.status==4}}" class="icon" src="/images/order-details/icon-jycg.png"></image>
</view>
<view class="right-text">
<view class="status red">{{orderDetail.orderInfo.statusStr}}</view>
<view class="des" hidden="true">请于11时59分59秒内付款超时订单将自动关闭</view>
</view>
</view>
<block wx:if="{{orderDetail.logistics}}">
<view wx:if="{{orderDetail.logisticsTraces}}" class="wuliu-box">
<view class="icon-box">
<image class="icon" src="/images/order-details/icon-wuliu.png"></image>
</view>
<view class="right-text" bindtap="wuliuDetailsTap" data-id="{{orderDetail.orderInfo.id}}">
<view class="order-number">快递单号:{{orderDetail.logistics.trackingNumber}}</view>
<block wx:if="{{orderDetail.logisticsTraces}}">
<view class="wuliu-text">{{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptStation}}</view>
<view class="wuliu-date">{{orderDetail.logisticsTraces[orderDetail.logisticsTraces.length-1].AcceptTime}}</view>
</block>
</view>
<view class="arrow-right">
<image class="arrow" src="/images/arrow-right.png"></image>
</view>
</view>
<view wx:else class="wuliu-box">
<view class="icon-box">
<image class="icon" src="/images/order-details/icon-wuliu.png"></image>
</view>
<view class="right-text">
<view class="order-number">快递单号:{{orderDetail.logistics.trackingNumber}}</view>
<view class="wuliu-text">暂无物流信息</view>
</view>
</view>
<view class="address-sec">
<view class="icon-box">
<image class="icon" src="/images/order-details/icon-address.png"></image>
</view>
<view class="right-box">
<view class="name-tel">{{orderDetail.logistics.linkMan}} {{orderDetail.logistics.mobile}}</view>
<view class="text">
{{orderDetail.logistics.address}}
</view>
</view>
</view>
</block>
</view>
<view class="goods-list">
<view class="list-title">商品信息</view>
<form bindsubmit="submitReputation" report-submit="true">
<block wx:for-items="{{orderDetail.goods}}" wx:key="{{index}}">
<view class="a-goods">
<view class="img-box">
<image src="{{item.pic}}" class="img" />
</view>
<view class="text-box">
<view class="arow arow01">
<view class="goods-name">{{item.goodsName}}</view>
<view class="goods-price">¥ {{item.amount}}</view>
</view>
<view class="arow">
<view class="goods-label">{{item.property}}</view>
<view class="goods-num">x {{item.number}}</view>
</view>
</view>
</view>
<view class="btn-row" wx:if="{{orderDetail.orderInfo.status==3}}">
<view class="section section_gap">
<view style="margin-top:35rpx;margin-bottom:35rpx;">评价:</view>
<radio-group name="goodReputation{{index}}">
<label style="margin-right:35rpx;"><radio value="2" checked/>好评</label>
<label style="margin-right:35rpx;"><radio value="1"/>中评</label>
<label style="margin-right:35rpx;"><radio value="0"/>差评</label>
</radio-group>
</view>
<view class="row-box" style="margin-top:35rpx">
<view class="row-label">备注</view>
<input name="orderGoodsId{{index}}" value="{{item.id}}" style="display:none;"/>
<textarea name="goodReputationRemark{{index}}" style="margin-top:35rpx;width:100%;" value="非常愉快的一次购物!" />
</view>
</view>
</block>
<view class="btn-row" wx:if="{{orderDetail.orderInfo.status==3}}">
<navigator style="float:right;" class="confirm-btn" target="miniProgram" app-id="wx56c8f077de74b07c" path="/open/order-comment/order-comment?appid={{appid}}&order_id={{orderDetail.orderInfo.orderNumber}}">去购物单评价</navigator>
<button style="float:right;" class="confirm-btn" formType="submit">提交评价</button>
</view>
</form>
<form bindsubmit="confirmBtnTap" report-submit="true">
<view class="btn-row" wx:if="{{orderDetail.orderInfo.status==2}}">
<button class="confirm-btn" formType="submit">确认收货</button>
</view>
</form>
</view>
<view class="peisong-way" hidden="true">
<view class="row-box">
<view class="row-label">配送方式</view>
<view class="right-text">顺丰快递</view>
</view>
<view class="row-box">
<view class="row-label">留言</view>
<view class="right-text">
<input name="remark" type="text" class="liuyan" placeholder="如需留言请输入" />
</view>
</view>
</view>
<view class="goods-info">
<view class="row-box">
<view class="row-label">商品金额</view>
<view class="right-text">¥ {{orderDetail.orderInfo.amount}}</view>
</view>
<view class="row-box">
<view class="row-label">运费</view>
<view class="right-text">+ ¥ {{orderDetail.orderInfo.amountLogistics}}</view>
</view>
<view class="row-box">
<view class="row-label">应付总额</view>
<view class="right-text">¥ {{orderDetail.orderInfo.amountReal}}</view>
</view>
</view>
</view>

@ -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": "选择收货地址"
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save