pull/8/head
ldh 2023-03-29 20:33:19 +08:00
commit 0c9c0c4dc3
7 changed files with 428 additions and 482 deletions

7
env
View File

@ -1,3 +1,6 @@
# 版本号
SHOPRO_VERSION = v1.8.1
# 正式环境接口域名 # 正式环境接口域名
SHOPRO_BASE_URL = https://api.shopro.sheepjs.com SHOPRO_BASE_URL = https://api.shopro.sheepjs.com
@ -13,7 +16,5 @@ SHOPRO_API_PATH = /shop/api/
# 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀 # 客户端静态资源地址 空=默认使用服务端指定的CDN资源地址前缀 | local=本地 | http(s)://xxx.xxx=自定义静态资源地址前缀
SHOPRO_STATIC_URL = https://file.sheepjs.com SHOPRO_STATIC_URL = https://file.sheepjs.com
SHOPRO_VERSION = v1.8.1 # 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启)
# 是否开启直播 1 开启直播 | 0 关闭直播
SHOPRO_MPLIVE_ON = 0 SHOPRO_MPLIVE_ON = 0

View File

@ -151,6 +151,7 @@
cart.delete(cartItem.id); cart.delete(cartItem.id);
return; return;
} }
if(cartItem.goods_num === e) return;
cartItem.goods_num = e; cartItem.goods_num = e;
cart.update({ cart.update({
goods_id: cartItem.goods_id, goods_id: cartItem.goods_id,

View File

@ -3,13 +3,9 @@
<s-layout title="申请售后"> <s-layout title="申请售后">
<!-- 售后商品 --> <!-- 售后商品 -->
<view class="goods-box"> <view class="goods-box">
<s-goods-item <s-goods-item :img="state.goodsItem.goods_image" :title="state.goodsItem.goods_title"
:img="state.goodsItem.goods_image" :skuText="state.goodsItem.goods_sku_text" :price="state.goodsItem.goods_price"
:title="state.goodsItem.goods_title" :num="state.goodsItem.goods_num"></s-goods-item>
:skuText="state.goodsItem.goods_sku_text"
:price="state.goodsItem.goods_price"
:num="state.goodsItem.goods_num"
></s-goods-item>
</view> </view>
<uni-forms ref="form" v-model="formData" :rules="rules" label-position="top"> <uni-forms ref="form" v-model="formData" :rules="rules" label-position="top">
@ -18,17 +14,9 @@
<view class="item-title ss-m-b-20">售后类型</view> <view class="item-title ss-m-b-20">售后类型</view>
<view class="ss-flex-col"> <view class="ss-flex-col">
<radio-group @change="onRefundChange"> <radio-group @change="onRefundChange">
<label <label class="ss-flex ss-col-center ss-p-y-10" v-for="(item, index) in state.refundTypeList" :key="index">
class="ss-flex ss-col-center ss-p-y-10" <radio :checked="formData.type === item.value" color="var(--ui-BG-Main)" style="transform: scale(0.8)"
v-for="(item, index) in state.refundTypeList" :value="item.value" />
:key="index"
>
<radio
:checked="formData.type === item.value"
color="var(--ui-BG-Main)"
style="transform: scale(0.8)"
:value="item.value"
/>
<view class="item-value ss-m-l-8">{{ item.text }}</view> <view class="item-value ss-m-l-8">{{ item.text }}</view>
</label> </label>
</radio-group> </radio-group>
@ -47,13 +35,8 @@
<view class="refund-item u-m-b-20"> <view class="refund-item u-m-b-20">
<view class="item-title ss-m-b-20">联系方式</view> <view class="item-title ss-m-b-20">联系方式</view>
<view class="input-box u-flex"> <view class="input-box u-flex">
<uni-easyinput <uni-easyinput :inputBorder="false" type="number" v-model="formData.mobile" placeholder="请输入您的联系电话"
:inputBorder="false" paddingLeft="10" />
type="number"
v-model="formData.mobile"
placeholder="请输入您的联系电话"
paddingLeft="10"
/>
</view> </view>
</view> </view>
@ -61,23 +44,11 @@
<view class="refund-item"> <view class="refund-item">
<view class="item-title ss-m-b-20">相关描述</view> <view class="item-title ss-m-b-20">相关描述</view>
<view class="describe-box"> <view class="describe-box">
<uni-easyinput <uni-easyinput :inputBorder="false" class="describe-content" type="textarea" maxlength="120" autoHeight
:inputBorder="false" v-model="formData.content" placeholder="客官~请描述您遇到的问题,建议上传照片"></uni-easyinput>
class="describe-content"
type="textarea"
maxlength="120"
autoHeight
v-model="formData.content"
placeholder="客官~请描述您遇到的问题,建议上传照片"
></uni-easyinput>
<view class="upload-img"> <view class="upload-img">
<s-uploader <s-uploader v-model:url="formData.images" fileMediatype="image" limit="9" mode="grid"
v-model:url="formData.images" :imageStyles="{ width: '168rpx', height: '168rpx' }" />
fileMediatype="image"
limit="9"
mode="grid"
:imageStyles="{ width: '168rpx', height: '168rpx' }"
/>
</view> </view>
</view> </view>
</view> </view>
@ -86,9 +57,7 @@
<su-fixed bottom placeholder> <su-fixed bottom placeholder>
<view class="foot-wrap"> <view class="foot-wrap">
<view class="foot_box ss-flex ss-col-center ss-row-between ss-p-x-30"> <view class="foot_box ss-flex ss-col-center ss-row-between ss-p-x-30">
<button class="ss-reset-button contcat-btn" @tap="sheep.$router.go('/pages/chat/index')" <button class="ss-reset-button contcat-btn" @tap="sheep.$router.go('/pages/chat/index')"></button>
>联系客服</button
>
<button class="ss-reset-button ui-BG-Main-Gradient sub-btn" @tap="submit"></button> <button class="ss-reset-button ui-BG-Main-Gradient sub-btn" @tap="submit"></button>
</view> </view>
</view> </view>
@ -97,29 +66,17 @@
<su-popup :show="state.showModal" round="10" :showClose="true" @close="state.showModal = false"> <su-popup :show="state.showModal" round="10" :showClose="true" @close="state.showModal = false">
<view class="modal-box page_box"> <view class="modal-box page_box">
<view class="modal-head item-title head_box ss-flex ss-row-center ss-col-center" <view class="modal-head item-title head_box ss-flex ss-row-center ss-col-center">申请原因</view>
>申请原因</view
>
<view class="modal-content content_box"> <view class="modal-content content_box">
<radio-group @change="onChange"> <radio-group @change="onChange">
<label <label class="radio ss-flex ss-col-center" v-for="item in state.refundReasonList" :key="item.value">
class="radio ss-flex ss-col-center"
v-for="item in state.refundReasonList"
:key="item.value"
>
<view class="ss-flex-1 ss-p-20">{{ item.title }}</view> <view class="ss-flex-1 ss-p-20">{{ item.title }}</view>
<radio <radio :value="item.value" color="var(--ui-BG-Main)" :checked="item.value === state.currentValue" />
:value="item.value"
color="var(--ui-BG-Main)"
:checked="item.value === state.currentValue"
/>
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="modal-foot foot_box ss-flex ss-row-center ss-col-center"> <view class="modal-foot foot_box ss-flex ss-row-center ss-col-center">
<button class="ss-reset-button close-btn ui-BG-Main-Gradient" @tap="onReason" <button class="ss-reset-button close-btn ui-BG-Main-Gradient" @tap="onReason"></button>
>确定</button
>
</view> </view>
</view> </view>
</su-popup> </su-popup>
@ -135,7 +92,6 @@
showModal: false, showModal: false,
currentValue: 0, currentValue: 0,
goodsItem: {}, goodsItem: {},
// showSuccess: false,
reasonText: '', reasonText: '',
// //
refundTypeList: [ refundTypeList: [
@ -190,6 +146,9 @@
// //
async function submit() { async function submit() {
// #ifdef MP
sheep.$platform.useProvider('wechat').subscribeMessage('order_aftersale_change');
// #endif
let data = { let data = {
...formData, ...formData,
order_id: state.goodsItem.order_id, order_id: state.goodsItem.order_id,
@ -200,7 +159,6 @@
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
}); });
// state.showSuccess = true;
sheep.$router.go('/pages/order/aftersale/list'); sheep.$router.go('/pages/order/aftersale/list');
} }
} }
@ -247,9 +205,11 @@
background-color: #fff; background-color: #fff;
border-bottom: 1rpx solid #f5f5f5; border-bottom: 1rpx solid #f5f5f5;
padding: 30rpx; padding: 30rpx;
&:last-child { &:last-child {
border: none; border: none;
} }
// //
.describe-box { .describe-box {
width: 690rpx; width: 690rpx;

View File

@ -394,7 +394,7 @@
success: async function (res) { success: async function (res) {
if (res.confirm) { if (res.confirm) {
// #ifdef MP // #ifdef MP
sheep.$platform.useProvider('wechat').subscribeMessage('order_apply_refund'); sheep.$platform.useProvider('wechat').subscribeMessage('order_refund');
// #endif // #endif
const { error, data } = await sheep.$api.order.applyRefund(orderId); const { error, data } = await sheep.$api.order.applyRefund(orderId);
if (error === 0) { if (error === 0) {

View File

@ -1,53 +1,34 @@
<template> <template>
<s-layout title="充值" class="withdraw-wrap" navbar="inner"> <s-layout title="充值" class="withdraw-wrap" navbar="inner">
<view <view class="wallet-num-box ss-flex ss-col-center ss-row-between" :style="[
class="wallet-num-box ss-flex ss-col-center ss-row-between"
:style="[
{ {
marginTop: '-' + Number(statusBarHeight + 88) + 'rpx', marginTop: '-' + Number(statusBarHeight + 88) + 'rpx',
paddingTop: Number(statusBarHeight + 108) + 'rpx', paddingTop: Number(statusBarHeight + 108) + 'rpx',
}, },
]" ]">
>
<view class=""> <view class="">
<view class="num-title">当前余额</view> <view class="num-title">当前余额</view>
<view class="wallet-num">{{ userInfo.money }}</view> <view class="wallet-num">{{ userInfo.money }}</view>
</view> </view>
<button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/recharge-log')" <button class="ss-reset-button log-btn" @tap="sheep.$router.go('/pages/pay/recharge-log')"></button>
>充值记录</button
>
</view> </view>
<view class="recharge-box"> <view class="recharge-box">
<view class="recharge-card-box" v-if="state.data.status"> <view class="recharge-card-box" v-if="state.data.status">
<view class="input-label ss-m-b-50">充值金额</view> <view class="input-label ss-m-b-50">充值金额</view>
<view class="input-box ss-flex border-bottom ss-p-b-20" v-if="state.data.custom_status"> <view class="input-box ss-flex border-bottom ss-p-b-20" v-if="state.data.custom_status">
<view class="unit"></view> <view class="unit"></view>
<uni-easyinput <uni-easyinput v-model="state.recharge_money" type="digit" placeholder="请输入充值金额" :inputBorder="false">
v-model="state.recharge_money"
type="digit"
placeholder="请输入充值金额"
:inputBorder="false"
>
</uni-easyinput> </uni-easyinput>
</view> </view>
<view class="face-value-box ss-flex ss-flex-wrap ss-m-y-40"> <view class="face-value-box ss-flex ss-flex-wrap ss-m-y-40">
<button <button class="ss-reset-button face-value-btn" v-for="item in state.faceValueList" :key="item.money"
class="ss-reset-button face-value-btn" :class="[{ 'btn-active': state.recharge_money == parseFloat(item.money) }]" @tap="onCard(item.money)">
v-for="item in state.faceValueList"
:key="item.money"
:class="[{ 'btn-active': state.recharge_money == parseFloat(item.money) }]"
@tap="onCard(item.money)"
>
<text class="face-value-title">{{ item.money }}</text> <text class="face-value-title">{{ item.money }}</text>
<view v-if="item.gift" class="face-value-tag"> <view v-if="item.gift" class="face-value-tag">
{{ item.gift }}{{ state.data.gift_type == 'money' ? '元' : '积分' }}</view {{ item.gift }}{{ state.data.gift_type == 'money' ? '元' : '积分' }}</view>
>
</button> </button>
</view> </view>
<button <button class="ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main" @tap="onConfirm">
class="ss-reset-button save-btn ui-BG-Main-Gradient ss-m-t-60 ui-Shadow-Main"
@tap="onConfirm"
>
确认充值 确认充值
</button> </button>
</view> </view>
@ -93,6 +74,9 @@
recharge_money: state.recharge_money, recharge_money: state.recharge_money,
}); });
if (error === 0) { if (error === 0) {
// #ifdef MP
sheep.$platform.useProvider('wechat').subscribeMessage('money_change');
// #endif
sheep.$router.go('/pages/pay/index', { orderSN: data.order_sn, type: 'recharge' }); sheep.$router.go('/pages/pay/index', { orderSN: data.order_sn, type: 'recharge' });
} }
} }

View File

@ -135,7 +135,7 @@ export default class SheepPay {
const { error, data } = await this.prepay(); const { error, data } = await this.prepay();
if (error === 0) { if (error === 0) {
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
}`; }&orderType=${this.orderType}`;
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`; location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
} }
} }
@ -145,7 +145,7 @@ export default class SheepPay {
let { error, data } = await this.prepay(); let { error, data } = await this.prepay();
if (error === 0) { if (error === 0) {
const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment const redirect_url = `${getRootUrl()}pages/pay/result?orderSN=${this.orderSN}&payment=${this.payment
}`; }&orderType=${this.orderType}`;
location.href = data.pay_data + encodeURIComponent(redirect_url); location.href = data.pay_data + encodeURIComponent(redirect_url);
} }
} }

View File

@ -3,7 +3,7 @@ import uni from '@dcloudio/vite-plugin-uni';
import path from 'path'; import path from 'path';
// import viteCompression from 'vite-plugin-compression'; // import viteCompression from 'vite-plugin-compression';
import uniReadPagesV3Plugin from './sheep/router/utils/uni-read-pages-v3'; import uniReadPagesV3Plugin from './sheep/router/utils/uni-read-pages-v3';
import mpliveMainfestPlugin from './sheep/libs/mpLive-manifest-plugin'; import mpliveMainfestPlugin from './sheep/libs/mplive-manifest-plugin';
// https://vitejs.dev/config/ // https://vitejs.dev/config/