Compare commits
3 Commits
c34a1d6021
...
e6538f1ac9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6538f1ac9 | ||
|
|
2838add808 | ||
|
|
5ddeeeee58 |
@@ -5,7 +5,7 @@
|
||||
|
||||
import {req} from "../request"
|
||||
|
||||
const index = () => req({url: "orders"}) //全部订单
|
||||
const index = data => req({url: "orders", data: data}) //全部订单
|
||||
const unpaid = () => req({url: "orders/unpaid"}) //待付款
|
||||
const paid = () => req({url: "orders/paid"}) //待发货
|
||||
const delive = () => req({url: "orders/delivered"}) //待收货
|
||||
@@ -13,6 +13,9 @@ const refund = () => req({url: "orders/refunds"}) //退款
|
||||
const cancel = (orderId) => req({url: "orders/cancel/" + orderId}) //取消订单
|
||||
const orders = (orderId) => req({url: "orders/" + orderId}) //订单-详情
|
||||
const paymen = (orderId) => req({url: "payments/order/" + orderId}) //订单支付-详情
|
||||
const sign = (orderId) => req({url: "orders/sign/" + orderId}) //订单签收
|
||||
const goosRefund = (orderId) => req({url: "orders/refund/" + orderId}) //订单退货
|
||||
const formRefund = (orderId,data) => req({url: "orders/refund/" + orderId, method: "POST", data: data}) //订单退货-提交
|
||||
|
||||
export default({
|
||||
index,
|
||||
@@ -22,5 +25,9 @@ export default({
|
||||
refund,
|
||||
cancel,
|
||||
orders,
|
||||
paymen
|
||||
paymen,
|
||||
sign,
|
||||
refund,
|
||||
goosRefund,
|
||||
formRefund
|
||||
})
|
||||
@@ -3,8 +3,8 @@ import {errInfo} from './err'
|
||||
import {updToken} from './updateToken'
|
||||
|
||||
// 请求方式配置
|
||||
const api = "https://new-web-test.cnskl.com/api/"
|
||||
// const api = "https://mi-org.cnskl.com/api/"
|
||||
// const api = "https://new-web-test.cnskl.com/api/"
|
||||
const api = "https://mi-org.cnskl.com/api/"
|
||||
const header = {
|
||||
"Accept" : "application/json"
|
||||
}
|
||||
|
||||
21
app.json
21
app.json
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/user/index",
|
||||
"pages/user/companyMine/myActives/myActives",
|
||||
"pages/welcome/index",
|
||||
"pages/company/index",
|
||||
"pages/company/search/search",
|
||||
@@ -9,9 +7,28 @@
|
||||
"pages/richText/richText",
|
||||
"pages/login/login",
|
||||
"pages/card/index",
|
||||
"pages/user/index",
|
||||
"pages/user/user_coupon/user_coupon",
|
||||
"pages/user/user_coupon_data/user_coupon_data",
|
||||
"pages/mall/index",
|
||||
"pages/mall/mall_address/mall_address",
|
||||
"pages/mall/mall_address_form/mall_address_form",
|
||||
"pages/mall/mall_assess/mall_assess",
|
||||
"pages/mall/mall_assess_form/mall_assess_form",
|
||||
"pages/mall/mall_cart/mall_cart",
|
||||
"pages/mall/mall_classify/mall_classify",
|
||||
"pages/mall/mall_details/mall_details",
|
||||
"pages/mall/mall_goods/mall_goods",
|
||||
"pages/mall/mall_order/mall_order",
|
||||
"pages/mall/mall_order_data/mall_order_data",
|
||||
"pages/mall/mall_order_submit/mall_order_submit",
|
||||
"pages/mall/mall_pay/mall_pay",
|
||||
"pages/mall/mall_search/mall_search",
|
||||
"pages/mall/mall_video/mall_video",
|
||||
"pages/mall/mall_refund/mall_refund",
|
||||
"pages/live/index",
|
||||
"pages/ticket/index",
|
||||
"pages/ticket/goods/goods",
|
||||
"pages/home/index",
|
||||
"pages/home/companyInfo/companyInfo",
|
||||
"pages/home/noticeDetail/noticeDetail",
|
||||
|
||||
@@ -66,22 +66,24 @@ Page({
|
||||
if(i.is_check){
|
||||
sellerLength++
|
||||
if(sellerLength == goodsList.length){
|
||||
this.setData({
|
||||
allCheckbox: true
|
||||
})
|
||||
goodsList[goodsIndex].is_check = true
|
||||
// this.setData({
|
||||
// allCheckbox: true
|
||||
// })
|
||||
}
|
||||
}else{
|
||||
if(this.data.allCheckbox){
|
||||
goodsList[goodsIndex].is_check = false
|
||||
this.setData({
|
||||
allCheckbox: false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
carArr : goodsList
|
||||
})
|
||||
|
||||
this.allCheckbox('checkbox')
|
||||
|
||||
// 获取计算价格
|
||||
this.totalPrice()
|
||||
},
|
||||
@@ -89,25 +91,35 @@ Page({
|
||||
/**
|
||||
* 全选
|
||||
*/
|
||||
allCheckbox(){
|
||||
let bagList = this.data.carArr,
|
||||
allCheckbox(type){
|
||||
let goodsList = this.data.carArr,
|
||||
goodsLenght = 0,
|
||||
allCheckbox = this.data.allCheckbox
|
||||
|
||||
if (type == 'checkbox'){
|
||||
for (let j in goodsList) {
|
||||
if (goodsList[j].is_check) {
|
||||
goodsLenght++
|
||||
if (goodsLenght == goodsList.length) {
|
||||
allCheckbox = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
allCheckbox = !allCheckbox
|
||||
|
||||
for(let i of bagList){
|
||||
i.is_check = allCheckbox
|
||||
for (var i in goodsList){
|
||||
goodsList[i].is_check = allCheckbox
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.setData({
|
||||
paramsCart : params,
|
||||
allCheckbox : allCheckbox,
|
||||
carArr : bagList
|
||||
carArr : goodsList
|
||||
})
|
||||
|
||||
|
||||
console.log(this.data.paramsCart)
|
||||
|
||||
// 获取计算价格
|
||||
this.totalPrice()
|
||||
},
|
||||
@@ -160,6 +172,7 @@ Page({
|
||||
goodsList = this.data.carArr
|
||||
|
||||
for (let i of goodsList){
|
||||
console.log(goodsList)
|
||||
if(i.is_check){
|
||||
bagNumber = bagNumber + i.number
|
||||
allPrice = allPrice + i.total
|
||||
|
||||
@@ -141,10 +141,13 @@
|
||||
<text>1</text>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="footer-btn" bindtap="specsTap">
|
||||
<view class="footer-btn" bindtap="specsTap" wx:if="{{changeSku.prices.stock > 0}}">
|
||||
<view class="footer-btn-car">加入购物车</view>
|
||||
<view class="footer-btn-buy">立即购买</view>
|
||||
</view>
|
||||
<view class="footer-btn" wx:else>
|
||||
<view class="footer-btn-stock">暂无库存</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券弹出层 -->
|
||||
@@ -171,7 +174,9 @@
|
||||
</view>
|
||||
<view class="couponEject-list-name">{{item.title}}<text>无门槛免费使用</text></view>
|
||||
</view>
|
||||
<view wx:if="{{!item.isHave}}" class="couponEject-list-btn {{item.type_text == '代金券' ? 'couponEject-list-yellow' : ''}}" bindtap="drawTap" data-id="{{item.id}}">
|
||||
<view wx:if="{{!item.isHave}}"
|
||||
class="couponEject-list-btn {{item.type_text == '代金券' ? 'couponEject-list-yellow' : ''}}"
|
||||
bindtap="drawTap" data-id="{{item.id}}">
|
||||
立即领取
|
||||
</view>
|
||||
<view wx:else class="couponEject-list-btn {{item.type_text == '代金券' ? 'couponEject-list-yellow' : ''}}">
|
||||
@@ -193,7 +198,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="couponDraw-list-text">
|
||||
<view class="couponDraw-list-name">{{item.title}}<text>{{item.type_text == '免费券' ? '免费券' : item.full}}</text></view>
|
||||
<view class="couponDraw-list-name">
|
||||
{{item.title}}<text>{{item.type_text == '免费券' ? '免费券' : item.full}}</text></view>
|
||||
<view class="couponDraw-list-btn" bindtap="drawTap" data-id="{{item.id}}">立即领取</view>
|
||||
<view class="couponDraw-list-time">{{item.start_at}} - {{item.end_at}}</view>
|
||||
</view>
|
||||
@@ -254,7 +260,8 @@
|
||||
<view class="share-layer {{shareShow ? 'active':''}}">
|
||||
<view class="share-title">
|
||||
<text>分享</text>
|
||||
<image class="share-close" src="/static/mall_icon/close_icon.png" mode="aspectFill" bindtap="shareLayEnd"></image>
|
||||
<image class="share-close" src="/static/mall_icon/close_icon.png" mode="aspectFill" bindtap="shareLayEnd">
|
||||
</image>
|
||||
</view>
|
||||
<view class="share-cont">
|
||||
<button class="share-list share-list-after" hover-class="none" open-type="share">
|
||||
|
||||
@@ -440,6 +440,12 @@ view.footer-btn-buy {
|
||||
background-color: #f97b35;
|
||||
}
|
||||
|
||||
.footer-btn-stock {
|
||||
width: 100% !important;
|
||||
background-color: #999;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
/* 优惠券弹出层 */
|
||||
.couponBack,
|
||||
.specsBack {
|
||||
|
||||
@@ -10,8 +10,10 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
stateType : 'all', //订单类型
|
||||
stateType : 'index', //订单类型
|
||||
orderArr : [], //订单列表
|
||||
page : {}, //分页信息
|
||||
lodingStats : false //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -47,41 +49,22 @@ Page({
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
orderInfo(){
|
||||
orderInfo(page){
|
||||
let stateType = this.data.stateType
|
||||
|
||||
if(stateType == 'all') {
|
||||
wx.$api.order.index().then(res=>{
|
||||
wx.$api.order[stateType]({
|
||||
page : page || ''
|
||||
}).then(res=>{
|
||||
console.log(res)
|
||||
let listArr = this.data.orderArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data)
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
orderArr : newData,
|
||||
page : res.page,
|
||||
lodingStats : false
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'unpaid') {
|
||||
wx.$api.order.unpaid().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'paid') {
|
||||
wx.$api.order.paid().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'delive') {
|
||||
wx.$api.order.delive().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
} else if(stateType == 'refunds') {
|
||||
wx.$api.order.refund().then(res=>{
|
||||
this.setData({
|
||||
orderArr : res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -100,9 +83,44 @@ Page({
|
||||
*/
|
||||
orderDelete(e) {
|
||||
let orderId = e.currentTarget.dataset.orderid
|
||||
wx.$api.orders.cancel(orderId).then(res=>{
|
||||
wx.$api.order.cancel(orderId).then(res=>{
|
||||
// 获取列表
|
||||
this.orderInfo()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 签收订单
|
||||
*/
|
||||
orderSign(e) {
|
||||
let orderId = e.currentTarget.dataset.orderid
|
||||
wx.$api.order.sign(orderId).then(res=>{
|
||||
// 获取列表
|
||||
this.orderInfo()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
// 获取订单列表
|
||||
this.orderInfo()
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
|
||||
// 获取订单列表
|
||||
this.orderInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"usingComponents" : {},
|
||||
"navigationBarTitleText" : "订单列表"
|
||||
"navigationBarTitleText" : "订单列表",
|
||||
"enablePullDownRefresh" : true
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- 订单tab -->
|
||||
<view class="order-tab">
|
||||
<view class="order-tab-item {{stateType == 'all' ? 'active':''}}" data-state="all" bindtap="orderTab">
|
||||
<view class="order-tab-item {{stateType == 'index' ? 'active':''}}" data-state="index" bindtap="orderTab">
|
||||
全部
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'unpaid' ? 'active':''}}" data-state="unpaid" bindtap="orderTab">
|
||||
@@ -12,8 +12,9 @@
|
||||
<view class="order-tab-item {{stateType == 'delive' ? 'active':''}}" data-state="delive" bindtap="orderTab">
|
||||
待收货
|
||||
</view>
|
||||
<view class="order-tab-item {{stateType == 'refunds' ? 'active':''}}" data-state="refunds" bindtap="orderTab">
|
||||
已完成 <!-- 退款 -->
|
||||
<view class="order-tab-item {{stateType == 'refund' ? 'active':''}}" data-state="refund" bindtap="orderTab">
|
||||
申请退款
|
||||
<!-- 退款 -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-content" wx:if="{{orderArr != ''}}">
|
||||
@@ -22,7 +23,7 @@
|
||||
<view class="order-company-name">
|
||||
<image class="order-logo" src="/static/mall_icon/mallDetails_user.png"></image>
|
||||
{{goods.orderid}}
|
||||
<image class="order-arrow" src="/static/mall_icon/mall_arrow.png"></image>
|
||||
<!-- <image class="order-arrow" src="/static/mall_icon/mall_arrow.png"></image> -->
|
||||
</view>
|
||||
<view class="order-company-state">
|
||||
{{goods.state_text}}
|
||||
@@ -39,12 +40,26 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-footer">
|
||||
<view class="order-footer-btn order-footer-btn-back" wx:if="{{goods.canPay == true}}" data-orderid="{{goods.orderid}}"
|
||||
bindtap="orderPay">立即支付</view>
|
||||
<view class="order-footer-btn order-footer-btn-back" wx:if="{{goods.canPay == true}}"
|
||||
data-orderid="{{goods.orderid}}" bindtap="orderPay">立即支付</view>
|
||||
<view class="order-footer-btn" wx:if="{{goods.canCancel == true}}" data-orderid="{{goods.orderid}}"
|
||||
bindtap="orderDelete">取消订单</view>
|
||||
<navigator hover-class="none" url="/pages/mall/mall_order_data/mall_order_data?orderId={{goods.orderid}}" class="order-footer-btn">订单详情</navigator>
|
||||
<view class="order-footer-btn" wx:if="{{goods.canSign == true}}"
|
||||
data-orderid="{{goods.orderid}}" bindtap="orderSign">
|
||||
立即签收
|
||||
</view>
|
||||
<navigator class="order-footer-btn" wx:if="{{goods.canRefund == true}}" url="/pages/mall/mall_refund/mall_refund?orderId={{goods.orderid}}">申请退款</navigator>
|
||||
<navigator hover-class="none" url="/pages/mall/mall_order_data/mall_order_data?orderId={{goods.orderid}}"
|
||||
class="order-footer-btn">订单详情</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/icons/loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -156,3 +156,23 @@ page {
|
||||
border-color: #eb532a;
|
||||
color: #eb532a;
|
||||
}
|
||||
|
||||
/*
|
||||
* 页面信息提醒
|
||||
*/
|
||||
|
||||
.pages-loding {
|
||||
text-align: center;
|
||||
color: #747788;
|
||||
font-size: 28rpx;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.pages-loding image {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
.pagesLoding {
|
||||
text-align: center;
|
||||
}
|
||||
@@ -18,7 +18,6 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
console.log(options.orderId)
|
||||
this.orderData(options.orderId)
|
||||
},
|
||||
|
||||
@@ -52,6 +51,9 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回订单
|
||||
*/
|
||||
orderRun() {
|
||||
wx.navigateBack({
|
||||
delta: 1,
|
||||
@@ -80,4 +82,16 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 签收订单
|
||||
*/
|
||||
orderSign(e) {
|
||||
let orderId = e.currentTarget.dataset.orderid
|
||||
wx.$api.order.sign(orderId).then(res=>{
|
||||
wx.redirectTo({
|
||||
url: '/pages/mall/mall_order/mall_order',
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
@@ -18,7 +18,7 @@
|
||||
<view class="orderGoods-company">
|
||||
<image class="orderGoods-logo" src="/static/mall_icon/mallDetails_user.png"></image>
|
||||
{{orderData.type_text}}
|
||||
<image class="orderGoods-arrow" src="/static/mall_icon/mall_arrow.png"></image>
|
||||
<!-- <image class="orderGoods-arrow" src="/static/mall_icon/mall_arrow.png"></image> -->
|
||||
</view>
|
||||
<view class="orderGoods-goods-li" wx:for="{{orderData.items}}" wx:key="items">
|
||||
<image class="orderGoods-img" src="{{item.cover}}" mode="aspectFill"></image>
|
||||
@@ -58,14 +58,14 @@
|
||||
<view class="order-total-name">运费</view>
|
||||
¥{{orderData.freight}}
|
||||
</view>
|
||||
<!-- <view class="order-total-li">
|
||||
<view class="order-total-name">优惠</view>
|
||||
-¥10.00
|
||||
</view> -->
|
||||
<view class="order-total-li">
|
||||
<view class="order-total-name">需付款</view>
|
||||
<view class="order-total-name">优惠</view>
|
||||
¥{{orderData.coupons_all_price}}
|
||||
</view>
|
||||
<view class="order-total-li">
|
||||
<view class="order-total-name">实际付款</view>
|
||||
<view class="coupon-picker-red">
|
||||
¥{{orderData.amount}}
|
||||
¥{{orderData.total}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -82,7 +82,11 @@
|
||||
<view class="orderFooter-btn orderFooter-btn-back" wx:if="{{orderData.canPay == true}}" data-orderid="{{orderData.orderid}}" bindtap="orderPay">
|
||||
立即支付
|
||||
</view>
|
||||
<!-- <navigator class="orderFooter-btn orderFooter-btn-back" url="">申请退货</navigator> -->
|
||||
<view class="orderFooter-btn" wx:if="{{orderData.canSign == true}}" data-orderid="{{orderData.orderid}}" bindtap="orderSign">
|
||||
立即签收
|
||||
</view>
|
||||
<navigator class="orderFooter-btn" wx:if="{{orderData.canRefund == true}}" url="/pages/mall/mall_refund/mall_refund?orderId={{orderData.orderid}}">申请退款</navigator>
|
||||
|
||||
<!-- <view class="orderFooter-btn" bindtap="logisticsShow">查看物流</view> -->
|
||||
<view class="orderFooter-btn" bindtap="orderRun">返回订单</view>
|
||||
</view>
|
||||
|
||||
@@ -107,18 +107,13 @@ Page({
|
||||
remark : this.data.remark,
|
||||
address_id : this.data.addressDel.address_id
|
||||
}).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
} else {
|
||||
wx.$api.mall.orderBuy({
|
||||
goods_sku_id : this.data.goodBuyId,
|
||||
qty : this.data.goodBuyQty,
|
||||
user_coupon_id: this.data.couponId,
|
||||
remark : this.data.remark,
|
||||
address_id : this.data.addressDel.address_id
|
||||
}).then(res=>{
|
||||
let trade_no = res.trade_no
|
||||
// 获取code
|
||||
wx.login({
|
||||
success: res=>{
|
||||
wx.$api.mall.wechat({
|
||||
trade_no : res.trade_no
|
||||
code : res.code,
|
||||
trade_no : trade_no
|
||||
}).then(res=>{
|
||||
let payInfo = JSON.parse(res)
|
||||
wx.requestPayment({
|
||||
@@ -147,6 +142,55 @@ Page({
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
wx.$api.mall.orderBuy({
|
||||
goods_sku_id : this.data.goodBuyId,
|
||||
qty : this.data.goodBuyQty,
|
||||
user_coupon_id: this.data.couponId,
|
||||
remark : this.data.remark,
|
||||
address_id : this.data.addressDel.address_id
|
||||
}).then(res=>{
|
||||
let trade_no = res.trade_no
|
||||
|
||||
// 获取code
|
||||
wx.login({
|
||||
success: res=>{
|
||||
wx.$api.mall.wechat({
|
||||
code : res.code,
|
||||
trade_no : trade_no
|
||||
}).then(res=>{
|
||||
let payInfo = JSON.parse(res)
|
||||
wx.requestPayment({
|
||||
timeStamp: payInfo.timeStamp,
|
||||
nonceStr : payInfo.nonceStr,
|
||||
package : payInfo.package,
|
||||
paySign : payInfo.paySign,
|
||||
signType : payInfo.signType,
|
||||
success : res=>{
|
||||
if(res.errMsg == "requestPayment:ok"){
|
||||
wx.showToast({
|
||||
title: '支付成功',
|
||||
icon : 'success'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
wx.reLaunch({
|
||||
url: '/pages/mall/mall_order/mall_order'
|
||||
})
|
||||
},2000)
|
||||
}
|
||||
},
|
||||
fail : res=>{
|
||||
wx.reLaunch({
|
||||
url: '/pages/mall/mall_order/mall_order?stateType=unpaid'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -36,10 +36,13 @@ Page({
|
||||
* 订单支付
|
||||
*/
|
||||
payment() {
|
||||
// 获取code
|
||||
wx.login({
|
||||
success: res=>{
|
||||
wx.$api.mall.wechat({
|
||||
code : res.code,
|
||||
trade_no : this.data.orderData.trade_no
|
||||
}).then(res=>{
|
||||
console.log(res)
|
||||
let payInfo = JSON.parse(res)
|
||||
wx.requestPayment({
|
||||
timeStamp: payInfo.timeStamp,
|
||||
@@ -68,4 +71,6 @@ Page({
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
131
pages/mall/mall_refund/mall_refund.js
Normal file
131
pages/mall/mall_refund/mall_refund.js
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 企获客商城
|
||||
*/
|
||||
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
orderId : '', //商品id
|
||||
orderData : '', //退货商品
|
||||
refundTitle : [], //退货理由
|
||||
refundType : '', //退货类型
|
||||
refundIndex : 0, //退货理由index
|
||||
title : '', //退款原因
|
||||
typeIndex : 0, //退货类型index
|
||||
imgs : [], //图片页面显示
|
||||
paths : [], //图片上传服务器
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
orderId: options.orderId
|
||||
})
|
||||
wx.$api.order.goosRefund(options.orderId).then(res => {
|
||||
console.log(res)
|
||||
this.setData({
|
||||
orderData : res.order,
|
||||
refundTitle : res.refund_title,
|
||||
refundType : res.refund_type
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
*选择退款原因
|
||||
*/
|
||||
refundChange(e) {
|
||||
this.setData({
|
||||
refundIndex : e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上传图片
|
||||
*/
|
||||
|
||||
formUploadFile(){
|
||||
let count = 9 - this.data.imgs.length
|
||||
wx.chooseImage({
|
||||
count : count,
|
||||
success : res=>{
|
||||
// 上传图片
|
||||
if (res.tempFilePaths){
|
||||
let pathArr = res.tempFilePaths
|
||||
wx.showLoading({
|
||||
title: '上传中',
|
||||
})
|
||||
for (let i = 0; i < pathArr.length; i++){
|
||||
wx.$api.file.uploadImg(pathArr[i], {}).then(res=>{
|
||||
let imgArr = this.data.imgs,
|
||||
pathArr = this.data.paths
|
||||
imgArr.push(res.showpath)
|
||||
pathArr.push(res.path)
|
||||
this.setData({
|
||||
imgs : imgArr,
|
||||
paths: pathArr
|
||||
})
|
||||
})
|
||||
|
||||
if (i == pathArr.length - 1) {
|
||||
wx.hideLoading()
|
||||
}
|
||||
}
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '上传图片失败',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除图片
|
||||
*/
|
||||
removeImg(e){
|
||||
let imgArr = this.data.imgs,
|
||||
pathArr = this.data.paths,
|
||||
index = e.currentTarget.dataset.index
|
||||
|
||||
imgArr.splice(index, 1)
|
||||
pathArr.splice(index, 1)
|
||||
|
||||
this.setData({
|
||||
imgs : imgArr,
|
||||
paths : pathArr
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 申请退货
|
||||
*/
|
||||
refundSign(e) {
|
||||
let refundTitle = this.data.refundTitle,
|
||||
refundIndex = this.data.refundIndex,
|
||||
remark = e.detail.value.remark,
|
||||
paths = this.data.paths
|
||||
|
||||
console.log(paths)
|
||||
|
||||
wx.$api.order.formRefund(this.data.orderId,{
|
||||
title : refundTitle[refundIndex].title,
|
||||
remark : remark,
|
||||
type : 1,
|
||||
pictures: paths
|
||||
}).then(res => {
|
||||
wx.redirectTo({
|
||||
url: '/pages/mall/mall_order/mall_order',
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
4
pages/mall/mall_refund/mall_refund.json
Normal file
4
pages/mall/mall_refund/mall_refund.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents" : {},
|
||||
"navigationBarTitleText": "退款"
|
||||
}
|
||||
87
pages/mall/mall_refund/mall_refund.wxml
Normal file
87
pages/mall/mall_refund/mall_refund.wxml
Normal file
@@ -0,0 +1,87 @@
|
||||
<form bindsubmit="refundSign">
|
||||
<view class="refund-content">
|
||||
<!-- 退货产品 -->
|
||||
<view class="refund-goods">
|
||||
<view class="refund-good" wx:for="{{orderData.items}}" wx:key="index">
|
||||
<image class="refund-good-cover" src="{{item.cover}}"></image>
|
||||
<view class="refund-good-info">
|
||||
<view class="refund-good-title nowrap">{{item.title}}</view>
|
||||
<view class="refund-good-value nowrap">{{item.value}}</view>
|
||||
<view class="refund-good-price nowrap">单价:<text>{{item.price}}</text> X {{item.qty}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品信息 -->
|
||||
<view class="refund-statistical">
|
||||
<view class="refund-statistical-item">
|
||||
商品总金额
|
||||
<label class="refund-statistical-item-label">¥{{orderData.amount || '0.00'}}</label>
|
||||
</view>
|
||||
<view class="refund-statistical-item">
|
||||
运费
|
||||
<label class="refund-statistical-item-label">¥{{orderData.freight || '0.00'}}</label>
|
||||
</view>
|
||||
<view class="refund-statistical-item">
|
||||
优惠券抵扣
|
||||
<label class="refund-statistical-item-label">¥{{orderData.coupons_all_price || '0.00'}}</label>
|
||||
</view>
|
||||
<view class="refund-statistical-item">
|
||||
实际支付金额
|
||||
<label class="refund-statistical-item-label">¥{{orderData.total || '0'}}</label>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退款原因 -->
|
||||
<view class="refund-statistical refund-info">
|
||||
<view class="refund-statistical-item">
|
||||
退款金额
|
||||
<label
|
||||
class="refund-statistical-item-label refund-info-item-label">¥{{orderData.total || '0.00'}}</label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="refund-statistical refund-info">
|
||||
<view class="refund-statistical-item refundTitle-item">
|
||||
选择退款原因
|
||||
<picker bindchange="refundChange" range-key="remark" value="{{refundIndex}}" range="{{refundTitle}}">
|
||||
<view class="picker">
|
||||
{{refundTitle[refundIndex].remark}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="refund-statistical refund-info">
|
||||
<view class="refund-statistical-item">
|
||||
退款类型
|
||||
<label class="refund-statistical-item-label">{{refundType[1]}}</label>
|
||||
</view>
|
||||
</view>
|
||||
<view class="refund-statistical refund-info">
|
||||
<view class="refund-info-item-text">
|
||||
退款原因
|
||||
<textarea class="refund-info-item-textarea" placeholder="输入退款原因" name="remark"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="refund-statistical refund-info">
|
||||
<view class="refund-info-item-text">
|
||||
添加图片
|
||||
<view class="issue-info-img">
|
||||
<view class="issue-info-img-itme issue-info-img-tag" wx:for="{{imgs}}" wx:key="imgs">
|
||||
<image class="form-img" mode="aspectFill" src="{{item}}"></image>
|
||||
<text class="issue-info-img-remove" data-index="{{index}}" bindtap="removeImg">×</text>
|
||||
</view>
|
||||
<view class="issue-info-img-itme" wx:if="{{imgs.length < 9}}">
|
||||
<view class="issue-info-img-add" bindtap="formUploadFile">
|
||||
<image src="/static/images/images_add.png" mode="widthFix"></image>
|
||||
<view>添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-footer">
|
||||
<button class="refund-footer-btn" size="mini" form-type="submit">提交</button>
|
||||
</view>
|
||||
</form>
|
||||
223
pages/mall/mall_refund/mall_refund.wxss
Normal file
223
pages/mall/mall_refund/mall_refund.wxss
Normal file
@@ -0,0 +1,223 @@
|
||||
.refund-content {
|
||||
padding-bottom: 190rpx;
|
||||
}
|
||||
|
||||
.refund-goods {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.refund-good {
|
||||
position: relative;
|
||||
padding: 15rpx 30rpx;
|
||||
min-height: 198rpx;
|
||||
}
|
||||
|
||||
.refund-good::before {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 0;
|
||||
height: 1rpx;
|
||||
bottom: 1rpx;
|
||||
content: " ";
|
||||
background-color: #f5f5f5;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.refund-good-cover {
|
||||
height: 178rpx;
|
||||
width: 178rpx;
|
||||
background: #f6f6f6;
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: 15rpx;
|
||||
}
|
||||
|
||||
.refund-good-info {
|
||||
padding-left: 198rpx;
|
||||
}
|
||||
|
||||
.refund-good-title {
|
||||
font-weight: bold;
|
||||
margin: 15rpx 0;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.refund-good-value {
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.refund-good-price {
|
||||
line-height: 40rpx;
|
||||
color: gray;
|
||||
font-size: 28rpx;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.refund-good-price text {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/* 统计信息 */
|
||||
.refundTitle-item {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.refundTitle-item picker {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.refund-statistical {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.refund-statistical-item {
|
||||
position: relative;
|
||||
padding: 0 30rpx;
|
||||
line-height: 90rpx;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.refund-statistical-item::before {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 0;
|
||||
height: 1rpx;
|
||||
bottom: 1rpx;
|
||||
content: " ";
|
||||
background-color: #f5f5f5;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.refund-statistical-item:last-child::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.refund-statistical-item-label {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
width: 300rpx;
|
||||
text-align: right;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* 退款 */
|
||||
.refund-info {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.refund-info-item-label {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.refund-info-item-text {
|
||||
padding: 30rpx 30rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.refund-info-item-textarea {
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
.refund-footer {
|
||||
background: white;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 20rpx 30rpx 30rpx 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.refund-footer-btn[size="mini"] {
|
||||
background: #eb532a;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
color: white;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
/* 多图上传 */
|
||||
|
||||
.issue-info-img {
|
||||
padding: 20rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin: 0 -10rpx;
|
||||
}
|
||||
|
||||
.issue-info-img-itme {
|
||||
width: calc(33.33% - 20rpx);
|
||||
padding-top: calc(33.33% - 20rpx);
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
margin: 10rpx;
|
||||
}
|
||||
|
||||
.issue-info-img-itme>image {
|
||||
width: 100%;
|
||||
height: calc(100% - 20rpx);
|
||||
height: -webkit-calc(100% - 20rpx);
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.issue-info-img-remove {
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
top: -5rpx;
|
||||
right: -6rpx;
|
||||
height: 36rpx;
|
||||
width: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 34rpx;
|
||||
background: #ec202c;
|
||||
color: white;
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.issue-info-img-add {
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
bottom: 10rpx;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
background: #f3f4f8;
|
||||
color: #8d8d8d;
|
||||
font-size: 24rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
}
|
||||
|
||||
.issue-info-img-add image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
vertical-align: bottom;
|
||||
margin-bottom: 15rpx;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.issue-info-img-hint {
|
||||
line-height: 60rpx;
|
||||
color: #666;
|
||||
font-size: 26rpx;
|
||||
padding: 0 30rpx 15rpx 30rpx;
|
||||
}
|
||||
@@ -80,8 +80,9 @@
|
||||
"scene": null
|
||||
},
|
||||
{
|
||||
"name": "pages/home/beSureOrder/beSureOrder",
|
||||
"pathName": "pages/home/beSureOrder/beSureOrder",
|
||||
"name": "pages/user/index",
|
||||
"pathName": "pages/user/index",
|
||||
"query": "",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user