暂存code

This commit is contained in:
hejiangming
2025-05-07 09:54:33 +08:00
parent 78270eeda0
commit 007b002b81
403 changed files with 14507 additions and 6320 deletions
+3
View File
@@ -3,4 +3,7 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
<component name="ProjectType">
<option name="id" value="jpab" />
</component>
</project> </project>
+20
View File
@@ -2,9 +2,25 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
console.log('App Launch') console.log('App Launch')
const res = uni.getSystemInfoSync();
uni.setStorageSync('platform', res.platform);
// #ifdef APP-PLUS         
// 获取应用版本信息
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
uni.setStorageSync('version', inf.version); // 大版本号
uni.setStorageSync('versionCode', inf.versionCode); // 小版本号
});
let uuid = plus.device.uuid;
// #endif
}, },
onShow: function() { onShow: function() {
console.log('App Show') console.log('App Show')
// 隐藏原生tabbar
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
}, },
onHide: function() { onHide: function() {
console.log('App Hide') console.log('App Hide')
@@ -24,4 +40,8 @@
button { button {
margin-bottom: 15px; margin-bottom: 15px;
} }
img {
width: 100%;
height: auto; /* 保持图片比例 */
}
</style> </style>
-6
View File
@@ -1,6 +0,0 @@
// 公共
export const smsCode = "/api/common/sms/code";// 获取短信验证码
export const emailCode = "/api/common/email/code";// 获取邮件验证码
export const uploadImg = "/api/common/uploadImg";// 上传图片
export const getConfig = "/api/frontend/trade/getConfig";// 查询交易配置信息
export const getAdBanner = "/api/common/getAdBanner";// 查询广告banner
+36 -3
View File
@@ -1,11 +1,10 @@
import request from '@/utils/request.js'; // 引入封装的方法 import request from '@/utils/request.js'; // 引入封装的方法
import { APPID } from '@/utils/config.js'; // import { APPID } from '@/utils/config.js';
// 获取短信验证码 // 获取短信验证码
export function getUserList(data) { export function getUserList(data) {
// return request.post('/common/getSmsCode',qs.stringify(params)); // data.appId = APPID;
data.appId = APPID;
return request({ return request({
url: "/common/getSmsCode", url: "/common/getSmsCode",
method: "post", method: "post",
@@ -27,6 +26,40 @@ export function getCascadeRegion(data) {
return request({ return request({
url: "/common/getCascadeCategory", url: "/common/getCascadeCategory",
method: "get", method: "get",
data,
isShowLoading:false,
});
}
// 查询支持的银行
export function getSupportBank(data) {
return request({
url: "/common/getSupportBank",
method: "get",
data,
});
}
// 获取短信验证码
export function uploadImage(params) {
const formData = new FormData();
formData.append("file", params.file);
formData.append("type", params.type);
return request.post('/common/upload/image',formData);
}
export const uploadImg = "/common/upload/image";
/**
* 检查版本更新
* @param {Object} data
*/
export function checkAppVersion(data) {
return request({
url: "/common/checkAppVersion",
method: "post",
data, data,
}); });
} }
+426 -16
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+22 -33
View File
@@ -1,21 +1,20 @@
<template> <template>
<view class="choiceness_warp"> <view class="choiceness_warp">
<view class="choiceness_title"> <view class="choiceness_title">
<up-image src="/static/common/jingxuan_left.png" width="50" height="12" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/jingxuan_left.png" width="24" height="6" bgColor="#f1f6ff00"></up-image>
<view class="choiceness_title_msg">为您精选</view> <view class="choiceness_title_msg">为您精选</view>
<up-image src="/static/common/jingxuan_right.png" width="50" height="12" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/jingxuan_right.png" width="24" height="6" bgColor="#f1f6ff00"></up-image>
</view> </view>
<view class="choiceness_product"> <view class="choiceness_product">
<view v-for="item in productList" :key="item.id" class="choiceness_product_item" @click="jumpInfo(item)"> <view v-for="item in productList" :key="item.id" class="choiceness_product_item" @click="jumpInfo(item)">
<up-image :src="item.url" width="100%" height="140" bgColor="#f1f6ff00"></up-image> <up-image :src="item.url" width="100%" height="140" bgColor="#f1f6ff00"></up-image>
<view class="product_item_name">{{item.name}}</view> <view class="product_item_name">{{item.title}}</view>
<view class="product_item_price"> <view class="product_item_price">
<view class="price_"> <view class="price_">
<text>¥</text> <text>¥</text>
<text style="color:36rpx;">{{item.price}}</text> <text style="color:36rpx;">{{item.price}}</text>
<text>{{item.priceDouble}}</text>
</view> </view>
<view class="price_sell">已售{{item.sell}}件</view> <!-- <view class="price_sell">已售{{item.sell}}件</view> -->
</view> </view>
</view> </view>
</view> </view>
@@ -23,47 +22,37 @@
</template> </template>
<script> <script>
import { searchList } from '@/api/product.js';
export default { export default {
name:"choiceness", name:"choiceness",
data() { data() {
return { return {
productList:[ productList:[]
{
id:1,
url:"/static/common/product_def2.png",
name:"美的双开门冰箱大容量多层速冷冰箱",
price:"7088.",
priceDouble:"00",
sell:"1.4万",
type:0,
},{
id:2,
url:"/static/common/product_def2.png",
name:"西门子双开门家庭冰箱大开口设计",
price:"7088.",
priceDouble:"00",
sell:"1.4万",
type:1,//1 哈希优选
},{
id:2,
url:"/static/common/product_def2.png",
name:"西门子双开门家庭冰箱大开口设计",
price:"7088.",
priceDouble:"00",
sell:"1.4万",
type:1,//1 哈希优选
}
]
}; };
}, },
mounted() {
this.getSearchList();
},
methods: { methods: {
// //
jumpInfo(item){ jumpInfo(item){
console.log("item",item);
uni.navigateTo({ uni.navigateTo({
url: '/pages/productInfo/productInfo?id='+item.id, url: '/pages/productInfo/productInfo?id='+item.id,
}) })
}, },
async getSearchList(){
const params={
isRecomm:true,
page:1,
pageSize:66,
}
const resp = await searchList(params);
console.log("resp",resp);
if(resp && resp.bizcode === 100){
this.productList = resp.data
}
}
} }
} }
</script> </script>
+32 -2
View File
@@ -8,7 +8,7 @@
"index.home": "主页",// ok "index.home": "主页",// ok
"index.sort": "分类",// ok "index.sort": "分类",// ok
"index.hash.union": "哈希联盟",// ok "index.hash.union": "三荣联盟",// ok
"index.shopping.cart": "购物车",// ok "index.shopping.cart": "购物车",// ok
"index.mine": "我的",// ok "index.mine": "我的",// ok
@@ -39,5 +39,35 @@
"invite.friends.title":"邀请好友", "invite.friends.title":"邀请好友",
"order.submit.title":"提交订单" "order.submit.title":"提交订单",
"mine.winning.record.title":"中奖记录",
"mine.merchant.settlement.title":"商家入驻",
"mine.brand.settlement.title":"企业/品牌入驻",
"mine.coupon.title":"优惠卷",
"mine.get.prize":"领取奖品",
"mine.my.team.title":"我的团队",
// "mine.purse.bonus.withdraw.log.title":"提现记录",
"mine.settings.title":"设置",
"mine.about.us.title":"关于我们",
"mine.privacy.agreement.title":"隐私协议",
"mine.user.agreement.title":"软件许可及用户协议",
"mine.purse.mine_purse_log.title":"账户流水",
"purse.recharge.title":"现金余额充值",
"purse.exchange.title":"现金红包兑换",
"mine.user.product.title":"售后保障协议"
} }
+33 -2
View File
@@ -8,7 +8,7 @@
"index.home": "主页",// ok "index.home": "主页",// ok
"index.sort": "分类",// ok "index.sort": "分类",// ok
"index.hash.union": "哈希联盟",// ok "index.hash.union": "三荣联盟",// ok
"index.shopping.cart": "购物车",// ok "index.shopping.cart": "购物车",// ok
"index.mine": "我的",// ok "index.mine": "我的",// ok
@@ -38,5 +38,36 @@
"invite.friends.title":"邀请好友", "invite.friends.title":"邀请好友",
"order.submit.title":"提交订单" "order.submit.title":"提交订单",
"mine.winning.record.title":"中奖记录",
"mine.merchant.settlement.title":"商家入驻",
"mine.brand.settlement.title":"企业/品牌入驻",
"mine.coupon.title":"优惠卷",
"mine.get.prize":"领取奖品",
"mine.my.team.title":"我的团队",
// "mine.purse.bonus.withdraw.log.title":"提现记录",
"mine.settings.title":"设置",
"mine.about.us.title":"关于我们",
"mine.privacy.agreement.title":"隐私协议",
"mine.user.agreement.title":"软件许可及用户协议",
"mine.purse.mine_purse_log.title":"账户流水",
"purse.recharge.title":"现金余额充值",
"purse.exchange.title":"现金红包兑换",
"mine.user.product.title":"售后保障协议"
} }
+13 -5
View File
@@ -1,9 +1,9 @@
{ {
"name" : "哈希优品", "name" : "德商汇",
"appid" : "__UNI__DA4D660", "appid" : "__UNI__DA4D660",
"description" : "哈希优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。", "description" : "德商汇优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : "100", "versionCode" : 102,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
@@ -18,7 +18,9 @@
"delay" : 0 "delay" : 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : {}, "modules" : {
"Payment" : {}
},
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute" : {
/* android打包配置 */ /* android打包配置 */
@@ -46,7 +48,13 @@
"dSYMs" : false "dSYMs" : false
}, },
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : {}, "sdkConfigs" : {
"payment" : {
"alipay" : {
"__platform__" : [ "ios", "android" ]
}
}
},
"icons" : { "icons" : {
"android" : { "android" : {
"hdpi" : "unpackage/res/icons/72x72.png", "hdpi" : "unpackage/res/icons/72x72.png",
+11
View File
@@ -11,6 +11,7 @@
"axios": "0.27.2", "axios": "0.27.2",
"axios-adapter-uniapp": "^0.1.4", "axios-adapter-uniapp": "^0.1.4",
"axios-miniprogram-adapter": "^0.3.4", "axios-miniprogram-adapter": "^0.3.4",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"qs": "^6.14.0" "qs": "^6.14.0"
} }
@@ -103,6 +104,11 @@
"node": ">= 0.8" "node": ">= 0.8"
} }
}, },
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/dayjs": { "node_modules/dayjs": {
"version": "1.11.13", "version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
@@ -502,6 +508,11 @@
"delayed-stream": "~1.0.0" "delayed-stream": "~1.0.0"
} }
}, },
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"dayjs": { "dayjs": {
"version": "1.11.13", "version": "1.11.13",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz",
+1
View File
@@ -80,6 +80,7 @@
"axios": "0.27.2", "axios": "0.27.2",
"axios-adapter-uniapp": "^0.1.4", "axios-adapter-uniapp": "^0.1.4",
"axios-miniprogram-adapter": "^0.3.4", "axios-miniprogram-adapter": "^0.3.4",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"qs": "^6.14.0" "qs": "^6.14.0"
} }
+211 -64
View File
@@ -54,11 +54,7 @@
"path" : "pages/mine_bank_card/mine_bank_card", "path" : "pages/mine_bank_card/mine_bank_card",
"style" : "style" :
{ {
"navigationBarTitleText": "%bankCard.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
@@ -76,62 +72,35 @@
"path" : "pages/mine_address/mine_address", "path" : "pages/mine_address/mine_address",
"style" : "style" :
{ {
"navigationBarTitleText": "%address.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
"path" : "pages/mine_address_add/mine_address_add", "path" : "pages/mine_address_add/mine_address_add",
"style" : "style" :
{ {
"navigationBarTitleText": "%address.add.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
"path" : "pages/mine_authentication/mine_authentication", "path" : "pages/mine_authentication/mine_authentication",
"style" : "style" :
{ {
"navigationBarTitleText": "%authentication.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
"path" : "pages/mine_authentication_ok/mine_authentication_ok", "path" : "pages/mine_authentication_ok/mine_authentication_ok",
"style" : "style" :
{ {
"navigationBarTitleText": "%authentication.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" ,// 默认样式,会显示返回图标
"app-plus": {
"titleNView": {
"splitLine": {
"color":"#f2f2f2"
}
}
}
} }
}, },
{ {
"path" : "pages/mine_purse/mine_purse", "path" : "pages/mine_purse/mine_purse",
"style" : "style" :
{ {
"navigationBarTitleText": "%purse.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
@@ -153,7 +122,7 @@
"style" : "style" :
{ {
"navigationBarTitleText": "%purse.bonus.title%", "navigationBarTitleText": "%purse.bonus.title%",
"navigationBarBackgroundColor": "#ff7c41", "navigationBarBackgroundColor": "#03AD27",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标 "navigationStyle": "default" // 默认样式,会显示返回图标
@@ -170,11 +139,7 @@
"path" : "pages/register/register", "path" : "pages/register/register",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
@@ -227,22 +192,14 @@
"path" : "pages/order_submit/order_submit", "path" : "pages/order_submit/order_submit",
"style" : "style" :
{ {
"navigationBarTitleText": "%order.submit.title%", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#F5F5F5",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
"path" : "pages/order_submit_ok/order_submit_ok", "path" : "pages/order_submit_ok/order_submit_ok",
"style" : "style" :
{ {
"navigationBarTitleText": "", "navigationStyle": "custom"
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
} }
}, },
{ {
@@ -251,13 +208,196 @@
{ {
"navigationBarTitleText" : "" "navigationBarTitleText" : ""
} }
},
{
"path" : "pages/mine_winning_record/mine_winning_record",
"style" :
{
"navigationBarTitleText": "%mine.winning.record.title%",
"navigationBarBackgroundColor": "#F5F5F5",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/merchant_settlement/merchant_settlement",
"style" :
{
"navigationBarTitleText": "%mine.merchant.settlement.title%",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/brand_settlement/brand_settlement",
"style" :
{
"navigationBarTitleText": "%mine.brand.settlement.title%",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/accelerate/accelerate",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_my_team/mine_my_team",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_coupon/mine_coupon",
"style" :
{
"navigationBarTitleText": "%mine.coupon.title%",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/order_submit_error/order_submit_error",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/get_prize/get_prize",
"style" :
{
"navigationBarTitleText": "%mine.get.prize%",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/mine_my_team_list/mine_my_team_list",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_purse_bonus_withdraw_log/mine_purse_bonus_withdraw_log",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_settings/mine_settings",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_about_us/mine_about_us",
"style" :
{
"navigationBarTitleText": "%mine.about.us.title%",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/mine_privacy_agreement/mine_privacy_agreement",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_user_agreement/mine_user_agreement",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_collection_alipay/mine_collection_alipay",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/mine_purse_log/mine_purse_log",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/mine_purse_recharge/mine_purse_recharge",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/mine_purse_exchange/mine_purse_exchange",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/mine_product_agreement/mine_product_agreement",
"style" :
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/zfb_payment/zfb_payment",
"style" :
{
"navigationBarTitleText": "支付",
"navigationBarBackgroundColor": "#FFFFFF",
"navigationBarTextStyle": "black",
"enablePullDownRefresh": false,
"navigationStyle": "default" // 默认样式,会显示返回图标
}
},
{
"path" : "pages/payment_processing/payment_processing",
"style" :
{
"navigationStyle": "custom"
}
} }
], ],
"tabBar": { "tabBar": {
"color": "#808080FF", // "color": "#000000",
"selectedColor": "#ff7c41", // "selectedColor": "#03AD27",
"borderStyle": "black", // "borderStyle": "black",
"backgroundColor": "#F8F8F8", // "backgroundColor": "#F8F8F8",
"custom": true,
"list": [{ "list": [{
"pagePath": "pages/home/home", "pagePath": "pages/home/home",
"text": "%index.home%", "text": "%index.home%",
@@ -269,12 +409,14 @@
"text": "%index.sort%", "text": "%index.sort%",
"iconPath": "/static/column/sort.png", "iconPath": "/static/column/sort.png",
"selectedIconPath": "/static/column/sort_sel.png" "selectedIconPath": "/static/column/sort_sel.png"
}, { },
"pagePath": "pages/hash_union/hash_union", // {
"text": "%index.hash.union%", // "pagePath": "pages/hash_union/hash_union",
"iconPath": "/static/column/hx.png", // "text": "%index.hash.union%",
"selectedIconPath": "/static/column/hx_sel.png" // "iconPath": "/static/column/hx.png",
}, { // "selectedIconPath": "/static/column/hx_sel.png"
// },
{
"pagePath": "pages/shopping_cart/shopping_cart", "pagePath": "pages/shopping_cart/shopping_cart",
"text": "%index.shopping.cart%", "text": "%index.shopping.cart%",
"iconPath": "/static/column/shopping.png", "iconPath": "/static/column/shopping.png",
@@ -288,6 +430,11 @@
] ]
}, },
"globalStyle": { "globalStyle": {
"navigationStyle": "custom" "navigationStyle": "custom",
"app-plus": {
"safearea": {
"bottom": "env(safe-area-inset-bottom)"
}
}
} }
} }
+286 -5
View File
@@ -1,19 +1,219 @@
<template> <template>
<view class="hash_union_warp"> <view class="hash_union_warp">
<view class="not_order_warp"> <view class="hash_union_content">
<up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image> <!-- 头部 -->
<view class="not_order_msg_warp">暂无相关数据</view> <view class="content_header">
<view class="header_union_comm">
<up-image src="/static/common/address3.png" width="16" height="18" bgColor="#f1f6ff00"></up-image>
<view class="msg_">二七广场丹尼斯</view>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right.png" width="18" height="18" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
<view class="header_union_comm">
<view style="width: 200rpx;">
<up-search
shape="square"
bgColor="#EEEEEEFF"
color="#666666FF"
:showAction="false"
placeholder="搜索"
></up-search>
</view>
</view>
</view>
<!-- banner图 -->
<up-swiper
:list="swiperList"
height="120"
radius="10"
@change="e => currentNum = e.current"
bgColor="#ffffff00"
>
<template #indicator>
<view
class="indicator-num"
>
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ swiperList.length }}</text>
</view>
</template>
</up-swiper>
<!-- 分类 -->
<view class="sort_comm_warp">
<view v-for="item in sortList" :key="item.id" class="sort_item_comm">
<up-image :src="item.icon" width="40" height="32" bgColor="#f1f6ff00"></up-image>
<view class="sort_item_title_comm">{{item.name}}</view>
</view>
</view>
</view>
<!-- 附近列表 -->
<view class="hash_union_nearby">
<view class="header_">
<view class="left_">
<view class="item_comm">
<view style="margin-top: 4rpx;">
<up-image src="/static/common/address3.png" width="10" height="12" bgColor="#f1f6ff00"></up-image>
</view>
<text style="margin: 0 10rpx; 0 6rpx;">附近</text>
<view style="margin-top: 6rpx;">
<up-image src="/static/common/buttom.png" width="10" height="12" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view class="item_comm" style="margin-left: 10rpx;">
<text style="margin-right: 10rpx;">综合排序</text>
<view style="margin-top: 6rpx;">
<up-image src="/static/common/buttom.png" width="10" height="12" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view>
<view class="item_comm">查看更多</view>
</view>
<view class="content_">
<view
class="content_item"
v-if="contentList && contentList.length !==0"
v-for="item in contentList"
:key="item.id"
>
<up-image src="/static/common/bianlidian.jpg" width="80" height="80" bgColor="#f1f6ff00" radius="10"></up-image>
<view class="content_item_right">
<view class="title_">{{item.name}}</view>
<view class="rate_">
<up-rate v-model="item.rate" size="14"></up-rate>
<text>¥{{item.price}}/人</text>
<text>{{item.num}}去过</text>
</view>
<view>
{{item.tabs.join(" ")}}
</view>
<view class="address_">
<up-image src="/static/common/address3.png" width="10" height="12" bgColor="#f1f6ff00"></up-image>
<text style="margin-left: 10rpx;">{{item.address}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- <view class="not_order_warp">
<up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">暂未开放</view>
</view> -->
<CustomTabBar :tabIndex="2"/>
</view>
</template> </template>
<script> <script>
import CustomTabBar from '@/components/custom-tab-bar.vue';
export default { export default {
components:{CustomTabBar},
data() { data() {
return { return {
swiperList:[
'/static/home/banner04.png',
],
currentNum:0,
sortList:[
{
id:1,
icon:'/static/union/bh.png',
name:'百货',
},
{
id:2,
icon:'/static/union/fs.png',
name:'服饰',
},
{
id:3,
icon:'/static/union/wj.png',
name:'五金',
},
{
id:4,
icon:'/static/union/sm.png',
name:'数码',
},
{
id:5,
icon:'/static/union/jd.png',
name:'酒店',
},
{
id:6,
icon:'/static/union/xc.png',
name:'洗车',
},
{
id:7,
icon:'/static/union/yy.png',
name:'影院',
},
{
id:8,
icon:'/static/union/sh.png',
name:'商行',
},
{
id:9,
icon:'/static/union/bld.png',
name:'便利店',
},
{
id:10,
icon:'/static/union/yb.png',
name:'饮吧',
},
],
rateValue:4,
contentList:[
{
id:1,
name:"好又多便利店",
rate:4,//
price:12,
num:1854,
tabs:['便利店',"建业路/英协花园"],
address:"200m",
},
{
id:2,
name:"好又多便利店",
rate:4,//
price:12,
num:1854,
tabs:['便利店',"建业路/英协花园"],
address:"200m",
},
{
id:3,
name:"好又多便利店",
rate:4,//
price:12,
num:1854,
tabs:['便利店',"建业路/英协花园"],
address:"200m",
},
{
id:4,
name:"好又多便利店",
rate:4,//
price:12,
num:1854,
tabs:['便利店',"建业路/英协花园"],
address:"200m",
},
]
} }
}, },
onShow() {
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
},
methods: { methods: {
} }
@@ -22,8 +222,89 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.hash_union_warp{ .hash_union_warp{
height: 100vh; background-color: #FFFFFF;
height: calc(100vh - 140rpx);
overflow: hidden;
.hash_union_content{
padding: 40rpx 20rpx;
.content_header{
display: flex;
justify-content: space-between;
align-items: center;
padding: 60rpx 0 20rpx;
}
.header_union_comm{
display: flex;
align-items: center;
}
.msg_{
font-weight: 500;
font-size: 28rpx;
color: #1A1A1A;
margin: 0 10rpx;
}
}
.hash_union_nearby{
background-color: $app-bj; background-color: $app-bj;
border-radius: 30rpx 30rpx 0rpx 0rpx;
padding: 30rpx;
.header_{
display: flex;
justify-content: space-between;
}
.left_{
display: flex;
}
.item_comm{
background: #FFFFFF;
border-radius: 28rpx;
padding: 10rpx 30rpx;
text-align: center;
font-weight: 500;
font-size: 26rpx;
color: #333333;
display: flex;
align-items: center;
}
.content_{
margin: 20rpx 0;
height: calc(100vh - 1020rpx);
overflow: auto;
}
.content_item{
background: #FFFFFF;
border-radius: 30rpx;
display: flex;
align-items: center;
padding:20rpx;
margin-bottom: 20rpx;
.content_item_right{
margin-left: 20rpx;
font-weight: 500;
font-size: 18rpx;
color: #999999;
width: calc(100% - 40rpx);
}
.title_{
font-weight: bold;
font-size: 30rpx;
color: #333333;
}
.rate_{
display: flex;
align-items: center;
margin: 10rpx 0 6rpx;
}
.address_{
display: flex;
align-items: center;
margin-top: 10rpx;
}
}
}
.not_order_warp { .not_order_warp {
display: grid; display: grid;
justify-content: center; justify-content: center;
+277 -114
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+27 -10
View File
@@ -1,7 +1,7 @@
<template> <template>
<view class="login_warp"> <view class="login_warp">
<view class="login_logo_warp"> <view class="login_logo_warp">
<view style="margin-left: 8rpx;"> <view style="text-align: center;">
<up-image src="/static/logo.png" width="90" height="90" bgColor="#f1f6ff00" radius="10"></up-image> <up-image src="/static/logo.png" width="90" height="90" bgColor="#f1f6ff00" radius="10"></up-image>
</view> </view>
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
@@ -55,7 +55,6 @@
</view> </view>
<view class="login_comm_but login_comm_but_yes" @click="loginFun"> <view class="login_comm_but login_comm_but_yes" @click="loginFun">
<up-loading-icon color="#FFFFFF" :show="butLoading"></up-loading-icon>
<text style="margin-left: 10rpx;">登录</text> <text style="margin-left: 10rpx;">登录</text>
</view> </view>
<view class="cut_way_warp"> <view class="cut_way_warp">
@@ -76,9 +75,11 @@
> >
<template #label> <template #label>
<text>已阅读并同意</text> <text>已阅读并同意</text>
<text class="policy_a_warp">《哈希优品服务协议》</text> <text class="policy_a_warp" @click="jumpUserAgreement">《服务协议》</text>
<text>及</text> <text>、</text>
<text class="policy_a_warp">《隐私政策》</text> <text class="policy_a_warp" @click="jumpPrivacyAgreement">《隐私政策》</text>
<text>、</text>
<text class="policy_a_warp" @click="jumpProductAgreement">《售后保障协议》</text>
</template> </template>
</up-checkbox> </up-checkbox>
</view> </view>
@@ -93,6 +94,7 @@
import { getUserList } from '@/api/common.js'; import { getUserList } from '@/api/common.js';
import { loginbysms,loginbypw } from '@/api/auth.js'; import { loginbysms,loginbypw } from '@/api/auth.js';
import { setStorageFun,TOKEN_NAME,USER_KEY,USER_DATA,USER_LOGIN_TIME } from '@/utils/auth.js'; import { setStorageFun,TOKEN_NAME,USER_KEY,USER_DATA,USER_LOGIN_TIME } from '@/utils/auth.js';
import CryptoJS from 'crypto-js';
export default { export default {
components: { components: {
@@ -116,7 +118,6 @@
isShow:false,// 是否显示 isShow:false,// 是否显示
isPolicy:false,// 是否同意 isPolicy:false,// 是否同意
countdown:false,// 清空倒计时 countdown:false,// 清空倒计时
butLoading:false,
} }
}, },
methods: { methods: {
@@ -144,11 +145,10 @@
}); });
return; return;
} }
this.butLoading=true;
let response={}; let response={};
if(this.loginWay === 'password'){ if(this.loginWay === 'password'){
params.mobile = form.name; params.mobile = form.name;
params.password = form.password; params.password = CryptoJS.MD5(form.password).toString();
response = await loginbypw(params); response = await loginbypw(params);
}else{ }else{
params.mobile = form.name; params.mobile = form.name;
@@ -170,7 +170,6 @@
// 当前登录得时间戳 // 当前登录得时间戳
let currentTimeStamp = new Date().getTime(); let currentTimeStamp = new Date().getTime();
setStorageFun(USER_LOGIN_TIME,currentTimeStamp); setStorageFun(USER_LOGIN_TIME,currentTimeStamp);
this.butLoading=false;
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'success', type: 'success',
message: response.msg, message: response.msg,
@@ -219,7 +218,25 @@
uni.navigateTo({ uni.navigateTo({
url:"/pages/register/register", url:"/pages/register/register",
}) })
} },
// 用户协议
jumpUserAgreement(){
uni.navigateTo({
url: '/pages/mine_user_agreement/mine_user_agreement?backPath=login'
})
},
// 隐私协议
jumpPrivacyAgreement(){
uni.navigateTo({
url: '/pages/mine_privacy_agreement/mine_privacy_agreement?backPath=login'
})
},
// 售后保障协议
jumpProductAgreement(){
uni.navigateTo({
url: '/pages/mine_product_agreement/mine_product_agreement?backPath=login'
})
},
} }
} }
</script> </script>
+292 -65
View File
@@ -1,19 +1,27 @@
<template> <template>
<view class="mine_warp"> <view class="mine_warp">
<view class="mine_header"> <view class="mine_header">
<view class="mine_data" v-if="userData && Object.keys(userData).length!==0"> <view class="mine_login_data" v-if="currentUserData && Object.keys(currentUserData).length!==0">
<up-image src="/static/mine/avatar.png" shape="circle" width="80" height="80" bgColor="#f1f6ff00"></up-image> <view class="mine_data" >
<up-image src="/static/logo_y.png" shape="circle" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="mine_info"> <view class="mine_info">
<view class="mine_info_name"> <view class="mine_info_name">
<text style="margin-right: 20rpx;">{{userData.name || '暂无昵称'}}</text> <text style="margin-right: 20rpx;">{{currentUserData.name || '德商汇用户'}}</text>
<up-image src="/static/mine/lv01.png" width="10" height="18" bgColor="#f1f6ff00"></up-image> <view class="grade_warp" v-if="currentUserData && Object.keys(currentUserData).length !==0" >
<up-image :src="currentUserData.gradeLevel || currentUserData.gradeLevel === 0? '/static/mine/grade/V'+currentUserData.gradeLevel+'.png':'/static/mine/grade/V0.png'" width="96" height="26" bgColor="#f1f6ff00"></up-image>
<view :class="currentUserData.gradeName.length > 3 ? 'grade_key_warp grade_key_warp3' : 'grade_key_warp grade_key_warp1'">{{currentUserData.gradeName}}</view>
</view>
</view> </view>
<view class="mine_info_id"> <view class="mine_info_id">
<text style="margin-right: 20rpx;">ID:{{userData.inviteCode}} </text> <text style="margin-right: 20rpx;">邀请码:{{currentUserData.inviteCode}} </text>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(userData.inviteCode)"></up-image> <up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(currentUserData.inviteCode)"></up-image>
</view> </view>
</view> </view>
</view> </view>
<view @click="jumpSetting">
<up-image src="/static/common/setting.png" width="22" height="22" bgColor="#f1f6ff00"></up-image>
</view>
</view>
<view class="mine_no_login_data" v-else> <view class="mine_no_login_data" v-else>
<view class="mine_data"> <view class="mine_data">
<up-image src="/static/mine/avater_not.png" shape="circle" width="80" height="80" bgColor="#f1f6ff00"></up-image> <up-image src="/static/mine/avater_not.png" shape="circle" width="80" height="80" bgColor="#f1f6ff00"></up-image>
@@ -41,6 +49,7 @@
<view class="mine_fontsize_comm_warp order_list_item" v-for="item in orderTemplList" :key="item.id" @click="jumpOrder(item)"> <view class="mine_fontsize_comm_warp order_list_item" v-for="item in orderTemplList" :key="item.id" @click="jumpOrder(item)">
<up-image :src="item.url" width="30" height="30" bgColor="#f1f6ff00"></up-image> <up-image :src="item.url" width="30" height="30" bgColor="#f1f6ff00"></up-image>
<view>{{item.title}}</view> <view>{{item.title}}</view>
<up-badge :absolute="true" :offset="[0,8]" max="99" :value="statisticsObj[item.note]"></up-badge>
</view> </view>
</view> </view>
</view> </view>
@@ -53,24 +62,28 @@
</view> </view>
<!-- 入驻 --> <!-- 入驻 -->
<view class="mine_top_comm_warp enter_list"> <view class="mine_top_comm_warp enter_list">
<view class="enter_item"> <view class="enter_item" @click="jumpEnter('merchant')">
<view> <view>
<view class="enter_title">商家入驻</view> <view class="enter_title">商家入驻</view>
<view class="enter_apply"> <view class="enter_apply">
<text class="enter_apply_title">申请</text> <text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
</view>
<up-image src="/static/mine/enter_sj.png" width="50" height="50" bgColor="#f1f6ff00"></up-image> <up-image src="/static/mine/enter_sj.png" width="50" height="50" bgColor="#f1f6ff00"></up-image>
</view> </view>
<view class="enter_item"> <view class="enter_item" @click="jumpEnter('brand')">
<view> <view>
<view class="enter_title">企业/品牌入驻</view> <view class="enter_title">企业/品牌入驻</view>
<view class="enter_apply"> <view class="enter_apply">
<text class="enter_apply_title">申请</text> <text class="enter_apply_title">申请</text>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right_y.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
</view>
<up-image src="/static/mine/enter_pp.png" width="50" height="50" bgColor="#f1f6ff00"></up-image> <up-image src="/static/mine/enter_pp.png" width="50" height="50" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
@@ -85,39 +98,97 @@
</view> </view>
</view> </view>
</view> </view>
<CustomTabBar :tabIndex="3"/>
<!-- 品牌入驻弹框 -->
<up-modal :show="brandShow" :showConfirmButton = "false">
<view class="slot-content">
<view class="close_warp" @click="brandShow=false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">企业入驻</view>
<view class="content_2">请联系负责人</view>
<view class="content_3">15888880123</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile('15888880123')">复制号码</view>
<view class="but_close" @click="brandShow=false;">取消</view>
</view>
</view>
</up-modal>
<!-- 我的客服 -->
<up-modal :show="serviceShow" :showConfirmButton = "false">
<view class="slot-content">
<view class="close_warp" @click="serviceShow = false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">联系客服</view>
<view class="content_3">13888888888</view>
</view>
<view class="but_">
<view class="but_copy" @click="copyMobile('13888888888')">复制号码</view>
<view class="but_close" @click="serviceShow=false;">取消</view>
</view>
</view>
</up-modal>
<!-- 暂未开放 -->
<up-modal :show="openShow" :showConfirmButton = "false">
<view class="slot-content">
<view class="close_warp" @click="openShow=false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">温馨提示</view>
<view class="content_2">暂未开放</view>
</view>
<view class="but_">
<view class="but_copy" @click="openShow=false;">确定</view>
</view>
</view>
</up-modal>
</view> </view>
</template> </template>
<script> <script>
import { getStorageFun,USER_DATA,clear } from '@/utils/auth.js' import { getStorageFun,USER_DATA,clear } from '@/utils/auth.js'
import { ORDER_TYPE } from '@/utils/enumUtils.js'; import { ORDER_TYPE,MINE_ORDER_TYPE } from '@/utils/enumUtils.js';
import { copyData } from '@/utils/index.js'; import { copyData } from '@/utils/index.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
import { getStatistics } from '@/api/order.js';
import { getUserInfo } from '@/api/auth.js'
export default { export default {
components:{CustomTabBar},
data() { data() {
return { return {
userData:{},// 当前登录对象 userData:{},// 当前登录对象
currentUserData:{},// 当前登录对象
orderTemplList:[ orderTemplList:[
{ {
id:ORDER_TYPE.UNPAID, id:ORDER_TYPE.UNPAID,
title:"待支付", title:"待支付",
url:'/static/mine/order_unpaid.png', url:'/static/mine/order_unpaid.png',
path:"/pages/mine_order/mine_order" path:"/pages/mine_order/mine_order?type="+MINE_ORDER_TYPE.UNPAID,
note:"unPayNum",
},{ },{
id:ORDER_TYPE.UNSHIPPED, id:ORDER_TYPE.UNSHIPPED,
title:"待发货", title:"待发货",
url:'/static/mine/order_unshipped.png', url:'/static/mine/order_unshipped.png',
path:"/pages/mine_order/mine_order" path:"/pages/mine_order/mine_order?type="+MINE_ORDER_TYPE.UNSHIPPED,
note:"unSentNum",
},{ },{
id:ORDER_TYPE.NOT_RECEIVE, id:ORDER_TYPE.NOT_RECEIVE,
title:"待收货", title:"待收货",
url:'/static/mine/order_notReceive.png', url:'/static/mine/order_notReceive.png',
path:"/pages/mine_order/mine_order" path:"/pages/mine_order/mine_order?type="+MINE_ORDER_TYPE.NOT_RECEIVE,
note:"unTakeNum",
},{ },{
id:ORDER_TYPE.SUCCEED, id:ORDER_TYPE.SUCCEED,
title:"待评价", title:"已完成",
url:'/static/mine/order_afterSale.png', url:'/static/mine/order_afterSale.png',
path:"/pages/mine_order/mine_order" path:"/pages/mine_order/mine_order?type="+MINE_ORDER_TYPE.SUCCEED,
note:"unCommentNum",
}, },
], ],
applyList:[ applyList:[
@@ -131,89 +202,159 @@
title:"抽奖", title:"抽奖",
url:'/static/mine/apply_prize.png', url:'/static/mine/apply_prize.png',
path:"/pages/turntable/turntable" path:"/pages/turntable/turntable"
},{
id:3,
title:"HM",
url:'/static/mine/apply_hm.png'
},{
id:4,
title:"贡献值",
url:'/static/mine/apply_gx.png'
},{
id:5,
title:"数据",
url:'/static/mine/apply_sj.png'
}, },
{
id:4,
title:"我的团队",
url:'/static/mine/tool_team.png',
path:"/pages/mine_my_team/mine_my_team"
},
{
id:5,
title:"加速次数",
url:'/static/mine/tool_js.png',
path:"/pages/accelerate/accelerate"
},
{
id:3,
title:"交易",
url:'/static/mine/apply_hm.png'
},
// {
// id:4,
// title:"贡献值",
// url:'/static/mine/apply_gx.png'
// },{
// id:5,
// title:"数据",
// url:'/static/mine/apply_sj.png'
// },
],// 应用模版 ],// 应用模版
toolList:[ toolList:[
{ {
id:1, id:5,
title:"IM聊天", title:"地址管理",
url:'/static/mine/tool_im.png' url:'/static/mine/tool_dz.png',
},{ path:'/pages/mine_address/mine_address'
id:2, },
title:"我的团队", {
url:'/static/mine/tool_team.png' id:9,
title:"实名认证",
url:'/static/mine/tool_sm.png',
},
{
id:10,
title:"银行卡管理",
url:'/static/mine/tool_card.png',
path:'/pages/mine_bank_card/mine_bank_card'
},{ },{
id:3, id:3,
title:"邀请好友", title:"邀请好友",
url:'/static/mine/tool_invite.png', url:'/static/mine/tool_invite.png',
path:'/pages/invite_friends/invite_friends' path:'/pages/invite_friends/invite_friends'
},{ },
id:4, // {
title:"加速次数", // id:2,
url:'/static/mine/tool_js.png' // title:"我的团队",
},{ // url:'/static/mine/tool_team.png',
id:5, // path:"/pages/mine_my_team/mine_my_team",
title:"地址管理", // },
url:'/static/mine/tool_dz.png', {
path:'/pages/mine_address/mine_address'
},{
id:6, id:6,
title:"卡券", title:"卡券",
url:'/static/mine/tool_kj.png' url:'/static/mine/tool_kj.png',
},{ // path:"/pages/mine_coupon/mine_coupon",
},
{
id:7, id:7,
title:"联系客服", title:"联系客服",
url:'/static/mine/tool_kf.png' url:'/static/mine/tool_kf.png'
},{ },
// {
// id:4,
// title:"加速次数",
// url:'/static/mine/tool_js.png',
// path:"/pages/accelerate/accelerate"
// },
{
id:8, id:8,
title:"商学院资讯", title:"商学院资讯",
url:'/static/mine/tool_sxy.png' url:'/static/mine/tool_sxy.png'
},{
id:9,
title:"实名认证",
url:'/static/mine/tool_sm.png',
path:"/pages/mine_authentication/mine_authentication"
},{
id:10,
title:"银行卡管理",
url:'/static/mine/tool_card.png',
path:'/pages/mine_bank_card/mine_bank_card'
}, },
{
id:11,
title:"RWA交易",
url:'/static/mine/tool_hxjy.png',
},
// {
// id:1,
// title:"IM聊天",
// url:'/static/mine/tool_im.png'
// },
],// 工具 ],// 工具
brandShow:false,// 品牌入驻弹框
statisticsObj:{
unPayNum:0,//待支付数量
unSentNum:0,//待发货数量
unTakeNum:0,//待收货数量
unCommentNum:0,//待评价数量
},// 角标统计
serviceShow:false,// 我的客服弹框
openShow:false,// 暂未开放
} }
}, },
onShow: function() { onShow() {
this.userData = getStorageFun(USER_DATA); this.userData = getStorageFun(USER_DATA);
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
this.getStatistics();
this.getUserInfo();
},
mounted() {
}, },
methods: { methods: {
copyData, copyData,
// 查询用户等级
async getUserInfo(){
const result = await getUserInfo();
if(result && result.bizcode === 100){
const data = result.data;
this.currentUserData = result.data || {};
}
},
/** /**
* 跳转到工具 * 跳转到工具
* @param {Object} item * @param {Object} item
*/ */
jumpTool(item){ jumpTool(item){
if(item.path){ // 客服
if(item.id === 7){
this.serviceShow = true;
}else if(item.id === 9){// 实名认证
const currentUserData = this.currentUserData;
let path = "/pages/mine_authentication/mine_authentication"
if(currentUserData && Object.keys(currentUserData).length !==0 && currentUserData.certStatus && currentUserData.certStatus !== 0){
path = "/pages/mine_authentication_ok/mine_authentication_ok"
}
uni.navigateTo({
url:path,
})
}else if(item.path){
uni.navigateTo({ uni.navigateTo({
url:item.path, url:item.path,
}) })
}else{
this.openShow = true;
} }
}, },
jumpOrder(item){ jumpOrder(item){
let path = '/pages/mine_order/mine_order' let path = '/pages/mine_order/mine_order'
if(item && Object.keys(item).length!==0){ if(item && Object.keys(item).length!==0){
path = '/pages/mine_order/mine_order?type='+item.id path = item.path;
} }
uni.navigateTo({ uni.navigateTo({
url:path, url:path,
@@ -223,14 +364,68 @@
uni.navigateTo({ uni.navigateTo({
url:'/pages/login/login', url:'/pages/login/login',
}) })
},
// 跳转到入驻页面
jumpEnter(type){
// 商家入驻
if(type === "merchant"){
// uni.navigateTo({
// url:'/pages/merchant_settlement/merchant_settlement',
// })
this.openShow = true;
}else if(type === "brand"){
// 企业/品牌入驻
// uni.navigateTo({
// url:'/pages/brand_settlement/brand_settlement',
// })
this.brandShow = true;
} }
},
copyMobile(mobile){
copyData(mobile);
this.brandShow = false;
},
// 查询统计
async getStatistics(){
const result = await getStatistics();
if(result && result.bizcode === 100 && result.data){
this.statisticsObj = {
...result.data,
unCommentNum:0,//待评价数量
};
}else{
this.statisticsObj = {
unPayNum:0,//待支付数量
unSentNum:0,//待发货数量
unTakeNum:0,//待收货数量
unCommentNum:0,//待评价数量
};
} }
},
jumpSetting(){
uni.navigateTo({
url: '/pages/mine_settings/mine_settings'
})
}
},
beforeDestroy(){
console.log('beforeDestry');
this.statisticsObj={
unPayNum:0,//待支付数量
unSentNum:0,//待发货数量
unTakeNum:0,//待收货数量
unCommentNum:0,//待评价数量
};// 角标统计
},
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.mine_warp{ .mine_warp{
height: 100vh; height: calc(100vh - 140rpx);
overflow: auto;
position: relative; position: relative;
background-color: $app-bj; background-color: $app-bj;
} }
@@ -240,6 +435,11 @@
background-size: 100% 100%; background-size: 100% 100%;
background-position: center; /* 将图片居中显示 */ background-position: center; /* 将图片居中显示 */
padding: 90rpx 40rpx 0; padding: 90rpx 40rpx 0;
.mine_login_data{
display: flex;
justify-content: space-between;
align-items: center;
}
} }
.mine_content_warp{ .mine_content_warp{
position: absolute; position: absolute;
@@ -249,10 +449,7 @@
left: 4%; left: 4%;
} }
.mine_data{
display: flex;
align-items: center;
}
.mine_no_login_data{ .mine_no_login_data{
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -265,6 +462,10 @@
color: #111111; color: #111111;
} }
} }
.mine_data{
display: flex;
align-items: center;
}
.mine_info_not_login{ .mine_info_not_login{
font-weight: bold; font-weight: bold;
font-size: 40rpx; font-size: 40rpx;
@@ -275,9 +476,30 @@
} }
.mine_info_name{ .mine_info_name{
font-weight: bold; font-weight: bold;
font-size: 40rpx; font-size: 36rpx;
color: #111111; color: #111111;
display: flex; display: flex;
.grade_warp{
position: relative;
}
.grade_key_warp{
position: absolute;
top: 0rpx;
left: 30%;
font-size: 24rpx;
color:#FFFFFF;
width:100rpx;
height:44rpx;
line-height: 50rpx;
text-align: center;
}
.grade_key_warp1{
font-size: 24rpx;
line-height: 48rpx;
}
.grade_key_warp3{
font-size: 20rpx;
}
} }
.mine_info_id{ .mine_info_id{
font-weight: 500; font-weight: 500;
@@ -324,6 +546,7 @@
.order_list_item{ .order_list_item{
width: 25%; width: 25%;
text-align: center; text-align: center;
position: relative;
} }
.apply_list{ .apply_list{
display: flex; display: flex;
@@ -378,4 +601,8 @@
text-align: center; text-align: center;
margin-top: 20rpx; margin-top: 20rpx;
} }
::v-deep .u-modal__content{
padding: 40rpx !important;
}
</style> </style>
+6 -3
View File
@@ -1,5 +1,6 @@
<template> <template>
<view class="mine_address_warp"> <view class="mine_address_warp">
<Header :leftTitle="$t('address.title')" left-path-type="switchTab" left-path="/pages/mine/mine"/>
<view v-for="item in addressList" :key="item.id" class="address_item" v-if="addressList && addressList.length !==0"> <view v-for="item in addressList" :key="item.id" class="address_item" v-if="addressList && addressList.length !==0">
<view class="address_item_info"> <view class="address_item_info">
<view>{{item.name}}</view> <view>{{item.name}}</view>
@@ -38,15 +39,18 @@
<script> <script>
import { getAddress,setAddressDefault,deleteAddress } from '@/api/address.js'; import { getAddress,setAddressDefault,deleteAddress } from '@/api/address.js';
import Header from '@/components/header.vue';
export default { export default {
data() { data() {
return { return {
addressList:[ addressList:[],
options:[
{text: '删除'}
] ]
} }
}, },
components:{Header},
mounted() { mounted() {
this.getAddressList(); this.getAddressList();
}, },
@@ -76,7 +80,6 @@
}, },
// 删除地址 // 删除地址
deleteAddressFun(item){ deleteAddressFun(item){
console.log("item",item);
const then = this; const then = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
+14 -29
View File
@@ -1,5 +1,6 @@
<template> <template>
<view class="address_add_warp"> <view class="address_add_warp">
<Header :leftTitle="$t('address.add.title')" left-path-type="navigateTo" :leftPath="leftPath"/>
<view class="address_form"> <view class="address_form">
<view class="add_form_item add_form_item_but"> <view class="add_form_item add_form_item_but">
<view class="add_form_title">收货人</view> <view class="add_form_title">收货人</view>
@@ -21,6 +22,7 @@
:customStyle="{ :customStyle="{
'border':'0rpx', 'border':'0rpx',
}" }"
type="number"
></up-input> ></up-input>
</view> </view>
<view class="add_form_item add_form_item_but" > <view class="add_form_item add_form_item_but" >
@@ -65,6 +67,8 @@
@change="regionChange" @change="regionChange"
keyName="label" keyName="label"
itemHeight="34" itemHeight="34"
@cancel="regionShow=false"
@close="regionShow=false"
></up-picker> ></up-picker>
</view> </view>
</template> </template>
@@ -72,8 +76,10 @@
<script> <script>
import { editAddress,getAddressDetail } from '@/api/address.js' import { editAddress,getAddressDetail } from '@/api/address.js'
import { getCascadeRegion } from '@/api/common.js' import { getCascadeRegion } from '@/api/common.js'
import Header from '@/components/header.vue';
export default { export default {
components:{Header},
data() { data() {
return { return {
form:{ form:{
@@ -90,6 +96,7 @@
regionShow:false, regionShow:false,
regionColumns:[], regionColumns:[],
regionLoading:false, regionLoading:false,
leftPath:"/pages/mine_address/mine_address",
} }
}, },
onLoad(option) { onLoad(option) {
@@ -97,6 +104,10 @@
if(id && id!==0){ if(id && id!==0){
this.getById(id); this.getById(id);
} }
const ids = option.ids;
if(ids && ids!==0){
this.leftPath = "/pages/order_submit/order_submit?ids="+ids+"&addressShow = true";
}
}, },
methods: { methods: {
/** /**
@@ -258,9 +269,10 @@
type: 'success', type: 'success',
message: params.id && params.id !==0 ? '修改成功':"添加成功", message: params.id && params.id !==0 ? '修改成功':"添加成功",
}); });
const leftPath = this.leftPath;
setTimeout(()=>{ setTimeout(()=>{
uni.navigateTo({ uni.navigateTo({
url:'/pages/mine_address/mine_address', url:leftPath,
}) })
},2000) },2000)
} }
@@ -273,32 +285,5 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.address_add_warp{
height: calc(100vh - 58rpx);
background-color: $app-bj;
padding: 30rpx;
}
.address_form{
background: #FFFFFF;
border-radius: 24rpx;
padding: 0 30rpx 30rpx;
}
.region_warp{
display: flex;
justify-content: space-between;
width: calc(100% - 160rpx);
}
.address_default{
background: #FFFFFF;
border-radius: 24rpx;
padding: 30rpx;
display: flex;
justify-content: space-between;
margin-top: 30rpx;
.title{
font-weight: bold;
font-size: 28rpx;
color: #222222;
}
}
</style> </style>
@@ -1,9 +1,10 @@
<template> <template>
<view class="authentication_warp"> <view class="authentication_warp">
<Header :leftTitle="$t('authentication.title')" left-path-type="switchTab" left-path="/pages/mine/mine"></Header>
<view class="data_common_warp"> <view class="data_common_warp">
<view class="data_msg">请填写商户本人的相关信息</view> <view class="data_msg">请填写用户本人得相关信息</view>
<view <view
:class="item.id < formList.length ?'add_form_item add_form_item_but':'add_form_item'" class="'add_form_item add_form_item_but'"
v-for="item in formList" v-for="item in formList"
:key="item.id" :key="item.id"
> >
@@ -13,43 +14,50 @@
border="surround" border="surround"
v-model="form[item.formName]" v-model="form[item.formName]"
:customStyle="inputCss" :customStyle="inputCss"
:type="item.type"
></up-input> ></up-input>
</view> </view>
</view> <view
<view class="data_common_warp"> class="add_form_item"
<view class="ID_card_title">上传证件照</view> >
<view class="ID_card_msg">(请务必上传本人证件照,生活照、艺术照将会被驳回)</view> <view class="add_form_title">证件类型</view>
<view class="ID_card_upload"> <view class="cert_" @click="certShowCheck(true)">
<view class="upload_item"> <view class="cert_title">{{form.certName || '请选择'}}</view>
<up-image src="/static/common/ID_rx.png" width="100%" height="90" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right.png" width="16" height="16" bgColor="#f1f6ff00"></up-image>
<view class="upload_msg">点击上传身份证人像面</view>
</view>
<view class="upload_item">
<up-image src="/static/common/ID_gq.png" width="100%" height="90" bgColor="#f1f6ff00"></up-image>
<view class="upload_msg">点击上传身份国旗面</view>
</view>
</view>
<view class="ID_card_upload_templ">
<view class="templ_title">上传标准</view>
<view class="templ_img_list">
<view class="templ_img_item" v-for="item in uploadTemplList" :key="item.id">
<up-image :src="item.url" width="100%" height="50" bgColor="#f1f6ff00"></up-image>
<view class="templ_img_item_msg">
<up-image :src="item.isOk ? '/static/common/ID_ok_1.png' :'/static/common/ID_error.png'" width="10" height="10" bgColor="#f1f6ff00"></up-image>
<view class="templ_img_item_msg_title">{{item.title}}</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
<!-- 证件照 -->
<CommonCard @valueFunc="getValue"/>
<view class="add_but" @click="addAuthentication"> <view class="add_but" @click="addAuthentication">
提交 提交
</view> </view>
<up-picker
:show="certShow"
:columns="[CERT_OPTION]"
keyName="value"
itemHeight="34"
@confirm="certConfirm"
@cancel="certShow=false"
@close="certShow=false"
></up-picker>
<up-toast ref="uToastRef"></up-toast>
</view> </view>
</template> </template>
<script> <script>
import CommonCard from '@/components/common_card.vue';
import Header from '@/components/header.vue';
import { realNameAuthentication } from '@/api/auth.js';
import { CERT_OPTION } from '@/utils/enumUtils.js';
export default { export default {
computed: {
CERT_OPTION() {
return CERT_OPTION;
},
},
components:{CommonCard,Header},
data() { data() {
return { return {
inputCss:{ inputCss:{
@@ -59,8 +67,11 @@
}, },
form:{ form:{
name:null, name:null,
mobile:null, certType:null,// 证状证件类型:1-居民身份证,2-护照
number:null,// 银行名称 certName:null,
certNo:null,// 证件号码
certFimg:null,// 证件正面照片
certBimg:null,// 证件背面照片
}, },
formList:[ formList:[
{ {
@@ -68,16 +79,13 @@
title:"真实姓名", title:"真实姓名",
formName:"name", formName:"name",
placeholder:"请输入您的真实姓名", placeholder:"请输入您的真实姓名",
},{ type:"text",
id:2,
title:"手机号",
formName:"mobile",
placeholder:"请输入手机号",
},{ },{
id:3, id:3,
title:"证件号码", title:"证件号码",
formName:"number", formName:"certNo",
placeholder:"请输入证件号码", placeholder:"请输入证件号码",
type:"text",
} }
], ],
uploadTemplList:[ uploadTemplList:[
@@ -102,11 +110,14 @@
isOk:false, isOk:false,
url:"/static/common/ID_error_3.png", url:"/static/common/ID_error_3.png",
} }
] ],
certShow:false,
certOption:[],
} }
}, },
methods: { methods: {
addAuthentication(){ async addAuthentication(){
const params={ const params={
...this.form ...this.form
} }
@@ -117,25 +128,66 @@
}); });
return; return;
} }
if(!params.mobile){ if(!params.certType){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "请输入手机号", message: "请选择证件类型",
}); });
return; return;
} }
if(!params.number){ if(!params.certNo){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "请输入证件号码", message: "请输入证件号码",
}); });
return; return;
} }
if(params.certFimg.length === 0){
this.$refs.uToastRef.show({
type: 'error',
message: "请上传证件正面照片",
});
return;
}
if(params.certBimg.length === 0){
this.$refs.uToastRef.show({
type: 'error',
message: "请上传证件背面照片",
});
return;
}
console.log("params",params); console.log("params",params);
const resp = await realNameAuthentication(params);
if(resp && resp.bizcode === 100){
uni.navigateTo({ uni.navigateTo({
url:'/pages/mine_authentication_ok/mine_authentication_ok', url:'/pages/mine_authentication_ok/mine_authentication_ok',
}) })
} }
},
// 提交地址
certConfirm(e){
const {
columnIndex,
value,
values,
index,
} = e;
const data = value[0];
this.form.certType = data.key;
this.form.certName = data.value;
this.certShowCheck(false);
},
// 选择银行的弹框
async certShowCheck(status){
this.certShow = status;
},
getValue(type,value){
if (type === "Z") {
this.form.certFimg = value;
} else if (type === "F") {
this.form.certBimg = value;
}
}
} }
} }
</script> </script>
@@ -145,17 +197,14 @@
height: calc(100vh - 58rpx); height: calc(100vh - 58rpx);
background-color: $app-bj; background-color: $app-bj;
padding: 30rpx; padding: 30rpx;
.data_common_warp{
background: #FFFFFF;
border-radius: 30rpx;
padding: 30rpx;
margin-bottom: 30rpx;
} }
.data_msg{ .cert_{
font-weight: 500; display: flex;
font-size: 26rpx; justify-content: space-between;
color: #F34343; width: calc(100% - 170rpx);
margin-bottom: 20rpx; .cert_title{
margin-left: 30rpx;
color:#9e9e9ec7
} }
} }
</style> </style>
@@ -1,35 +1,75 @@
<template> <template>
<view class="authentication_ok_warp"> <view class="authentication_ok_warp">
<Header :leftTitle="$t('authentication.title')" left-path-type="switchTab" left-path="/pages/mine/mine"/>
<view class="authentication_ok_content" v-if="currentUserData && Object.keys(currentUserData).length !==0">
<view class="authentication_result"> <view class="authentication_result">
<view class="result_title">您的实名认证</view> <view class="result_title">您的实名认证</view>
<view class="result_value">已通过!</view> <view class="result_value">{{getValue(CERT_STATUS_OPTION,currentUserData.certStatus)}}</view>
</view> </view>
<view class="authentication_info"> <view class="authentication_info">
<view class="info_item"> <view class="info_item">
<text class="info_item_title">证件姓名:</text> <text class="info_item_title">证件姓名:</text>
<text class="info_item_value">张某</text> <text class="info_item_value">{{currentUserData.name}}</text>
</view> </view>
<view class="info_item"> <view class="info_item">
<text class="info_item_title">证件性别:</text> <text class="info_item_title">证件类型:</text>
<text class="info_item_value">男</text> <text class="info_item_value">{{getValue(CERT_OPTION,currentUserData.certType)}}!</text>
</view> </view>
<view class="info_item"> <view class="info_item">
<text class="info_item_title">证件号码:</text> <text class="info_item_title">证件正面:</text>
<text class="info_item_value">448468454848458</text> <view class="info_item_value">
<up-image :src="currentUserData.certFimg" mode="widthFix" width="100%" height="140" bgColor="#f1f6ff00" :fade="true" duration="450"></up-image>
</view> </view>
</view> </view>
<view class="info_item">
<text class="info_item_title">证件背面:</text>
<view class="info_item_value">
<up-image :src="currentUserData.certBimg" mode="widthFix" width="100%" height="140" bgColor="#f1f6ff00" :fade="true" duration="450"></up-image>
</view>
</view>
</view>
</view>
<view v-else class="not_order_warp">
<up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">暂无相关认证信息</view>
</view>
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
</view> </view>
</template> </template>
<script> <script>
import Header from '@/components/header.vue';
import { getUserInfo } from '@/api/auth.js';
import { getValue,CERT_OPTION,CERT_STATUS_OPTION } from '@/utils/enumUtils.js';
export default { export default {
computed: {
CERT_OPTION() {
return CERT_OPTION;
},
CERT_STATUS_OPTION() {
return CERT_STATUS_OPTION;
},
},
components:{Header},
data() { data() {
return { return {
currentUserData:{},// 当前用户信息
} }
}, },
mounted() {
this.getUserInfo();
},
methods: { methods: {
getValue,
async getUserInfo(){
const result = await getUserInfo();
if(result && result.bizcode === 100){
const data = result.data;
console.log("data",data);
this.currentUserData = result.data || {};
}
},
} }
} }
</script> </script>
@@ -38,12 +78,15 @@
.authentication_ok_warp{ .authentication_ok_warp{
height: 100vh; height: 100vh;
background-color: #FFFFFF; background-color: #FFFFFF;
.authentication_ok_content{
padding: 60rpx; padding: 60rpx;
}
.authentication_result{ .authentication_result{
display: grid; display: grid;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
text-align: center; text-align: center;
margin-top: 100rpx;
.result_title{ .result_title{
font-weight: bold; font-weight: bold;
font-size: 40rpx; font-size: 40rpx;
+106 -34
View File
@@ -8,17 +8,38 @@
border="surround" border="surround"
v-model="form[item.formName]" v-model="form[item.formName]"
:customStyle="inputCss" :customStyle="inputCss"
:type="item.type"
></up-input> ></up-input>
</view> </view>
<view class="add_bank_form_item" >
<view class="add_title">银行</view>
<view class="bank_warp" @click="bankShowCheck(true)">
<view style="color: #808080;margin-left: 22rpx;font-size: 28rpx;">{{form.bankName || "选择银行"}}</view>
<up-image src="/static/common/right_soild.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view>
</view>
</view> </view>
<view class="add_but" @click="addBank"> <view class="add_but" @click="addBank">
添加 添加
</view> </view>
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
<up-picker
:show="bankShow"
:columns="bankOption"
keyName="bankName"
itemHeight="34"
@confirm="bankConfirm"
:loading="bankLoading"
@close="bankShow=false"
@cancel="bankShow=false"
></up-picker>
</view> </view>
</template> </template>
<script> <script>
import { bindBank } from '@/api/bank.js';
import { getSupportBank } from '@/api/common.js';
export default { export default {
data() { data() {
return { return {
@@ -30,74 +51,120 @@
"padding-left": "16px", "padding-left": "16px",
}, },
form:{ form:{
name:null, bankNo:null,//银行卡号
number:null, bankId:null,// 银行ID
bankName:null,// 银行名称 bankName:null,// 银行ID
bankBranch:null,// 开户支行 bankUsername:null,//银行卡开户姓名
iban:null,// IBAN bankPhone:null,//银行卡预留手机号码
}, },
formList:[ formList:[
{ {
id:1, id:1,
title:"姓名", title:"银行卡开户姓名",
formName:"name", formName:"bankUsername",
placeholder:"请输入姓名", placeholder:"请输入银行卡开户姓名",
type:'text',
},{
id:3,
title:"银行卡预留手机号码",
formName:"bankPhone",
placeholder:"请输入银行卡预留手机号码",
type:'number',
},{ },{
id:2, id:2,
title:"银行卡账号/卡号", title:"银行卡账号/卡号",
formName:"number", formName:"bankNo",
placeholder:"请输入账号", placeholder:"请输入账号",
},{ type:'number',
id:3,
title:"银行名称",
formName:"bankName",
placeholder:"请输入银行名称",
},{
id:4,
title:"开户支行(选填)",
formName:"bankBranch",
placeholder:"请属于您的开户支行",
},{
id:5,
title:"IBAN(选填)",
formName:"iban",
placeholder:"IBNA",
}, },
] ],
bankOption:[],// 银行列表选择
bankShow:false,
bankLoading:false,
} }
}, },
onLoad() {
},
methods: { methods: {
addBank(){ // 选择银行的弹框
async bankShowCheck(status){
if(status){
const resp = await getSupportBank();
if(resp && resp.bizcode === 100){
this.bankOption = [resp.data];
}
}else{
this.bankOption = [[]];
}
this.bankShow = status;
},
// 提交地址
bankConfirm(e){
const {
columnIndex,
value,
values,
index,
} = e;
if(!value || value.length === 0){
this.$refs.uToastRef.show({
type: 'error',
message: "请先选择银行",
});
return;
}
const data = value[0];
this.form.bankId = data.id;
this.form.bankName = data.bankName;
this.bankShowCheck(false);
},
async addBank(){
const param ={ const param ={
...this.form ...this.form
}; };
if(!param.name){ if(!param.bankUsername){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "请输入姓名", message: "请输入银行卡开户姓名",
}); });
return; return;
} }
if(!param.number){ if(!param.bankPhone){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "银行卡账号/卡号", message: "请输入银行卡预留手机号码",
}); });
return; return;
} }
if(!param.bankName){ if(!param.bankNo){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "银行名称", message: "请输入银行卡账号/卡号",
}); });
return; return;
} }
console.log("param",param); if(!param.bankId){
this.$refs.uToastRef.show({
type: 'error',
message: "请选择银行",
});
return;
}
delete param.bankName;
const resp = await bindBank(param);
if(resp && resp.bizcode === 100){
this.$refs.uToastRef.show({
type: 'sesses',
message: "绑定成功",
});
setTimeout(()=>{
uni.navigateTo({ uni.navigateTo({
url:'/pages/mine_bank_card/mine_bank_card', url:'/pages/mine_bank_card/mine_bank_card',
}) })
},2000)
} }
},
} }
} }
</script> </script>
@@ -123,5 +190,10 @@
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
} }
.bank_warp{
display: flex;
justify-content: space-between;
width: 100%;
}
</style> </style>
+68 -26
View File
@@ -1,60 +1,88 @@
<template> <template>
<view class="mine_bank_warp"> <view class="mine_bank_warp">
<Header :leftTitle="$t('bankCard.title')" left-path-type="switchTab" left-path="/pages/mine/mine"/>
<view class="mine_bank_content_warp">
<view class="bank_title"> <view class="bank_title">
银行卡({{bankList.length}}张) 银行卡({{bankList.length}}张)
</view> </view>
<view class="bank_list"> <view class="bank_list">
<view class="bank_item" v-for="item in bankList" :key="item.id" > <view v-if="bankList.length !== 0" class="bank_item" v-for="item in bankList" :key="item.id" >
<view class="bank_data"> <view class="bank_data">
<up-image :src="item.url" width="50" height="50" bgColor="#f1f6ff00"></up-image> <up-image :src="item.bankLogo || '/static/bank/default.png'" width="50" height="50" bgColor="#f1f6ff00"></up-image>
<view class="bank_info"> <view class="bank_info">
<view class="bank_bank_name">{{item.bankName}}</view> <view class="bank_bank_name">{{item.bankName}}</view>
<view class="bank_user_name">{{item.userName}}</view> <view class="bank_user_name">{{item.bankUsername}}</view>
</view> </view>
</view> </view>
<view class="bank_parting_line"></view> <view class="bank_parting_line"></view>
<view>{{item.number}}</view> <view class="operate_item">
<view>{{encipherBankNumber(item.bankNo)}}</view>
<view class="operate_" @click="deleteClick(item)">解绑</view>
</view>
</view>
<view v-else class="not_order_warp">
<up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">还未绑定银行卡哦~</view>
</view> </view>
</view> </view>
<view class="add_but" @click="jumpAddBank"> <view class="add_but" @click="jumpAddBank">
添加银行卡 添加银行卡
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
import { getBankList,bindBank,unbind } from '@/api/bank.js';
import { encipherBankNumber } from '@/utils/index.js';
import Header from '@/components/header.vue';
export default { export default {
components:{Header},
data() { data() {
return { return {
bankList:[ bankList:[],
{
id:1,
url:'/static/bank/default.png',
bankName:'中国交通银行',
userName:'张某某',
number:"**** **** **** 0865",
},{
id:2,
url:'/static/bank/default.png',
bankName:'中国农业银行',
userName:'张某某',
number:"**** **** **** 0769",
},{
id:3,
url:'/static/bank/default.png',
bankName:'中国农业银行',
userName:'张某某',
number:"**** **** **** 0769",
},
]
} }
}, },
onLoad() {
this.getBankList();
},
methods: { methods: {
encipherBankNumber,
jumpAddBank(){ jumpAddBank(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/mine_bank_add/mine_bank_add', url:'/pages/mine_bank_add/mine_bank_add',
}) })
},
async getBankList(){
const resp = await getBankList();
if(resp && resp.bizcode === 100){
this.bankList = resp.data || [];
} }
},
// 删除
deleteClick(item){
const then = this;
uni.showModal({
title: '提示',
content: '是否要解绑该银行卡?',
success: function (res) {
if (res.confirm) {
then.deleteFun(item);
}
}
});
},
// 删除的方法
async deleteFun(item){
const params={
id:item.id,
}
const respon = await unbind(params);
if(respon && respon.bizcode === 100){
this.getBankList();
}
},
} }
} }
</script> </script>
@@ -63,8 +91,10 @@
.mine_bank_warp{ .mine_bank_warp{
height: calc(100vh - 58rpx); height: calc(100vh - 58rpx);
background-color: $app-bj; background-color: $app-bj;
padding: 30rpx;
overflow-y: hidden; overflow-y: hidden;
.mine_bank_content_warp{
padding: 30rpx;
}
.bank_title{ .bank_title{
font-weight: bold; font-weight: bold;
font-size: 36rpx; font-size: 36rpx;
@@ -105,5 +135,17 @@
border-radius: 0rpx 0rpx 1rpx 1rpx; border-radius: 0rpx 0rpx 1rpx 1rpx;
margin: 30rpx auto; margin: 30rpx auto;
} }
.operate_item{
display: flex;
justify-content: space-between;
.operate_{
padding: 10rpx 30rpx;
background: #F3F3F3;
border-radius: 25rpx;
font-size: 24rpx;
color: #222222;
margin-left: 20rpx;
}
}
} }
</style> </style>
+174 -136
View File
@@ -7,20 +7,20 @@
<view class="order_type_title"> <view class="order_type_title">
<view <view
:class="form.type === item.id ? 'order_type_title_item order_type_title_item_sel':'order_type_title_item'" :class="form.type === item.id ? 'order_type_title_item order_type_title_item_sel':'order_type_title_item'"
v-for="item in orderTypeList" v-for="(item,index) in orderTypeList"
@click="checkType(item)" @click="checkType(item)"
:key="item.id" :key="index"
> >
{{item.title}} {{item.title}}
</view> </view>
</view> </view>
<view> <scroll-view scroll-y="true" @scrolltolower="loadMore" style="height: calc(100vh - 300rpx);">
<view v-if="orderList && orderList.length!==0" class="order_list_warp"> <view v-if="orderList && orderList.length!==0" class="order_list_warp">
<view class="order_item" v-for="item in orderList" :key="item.id"> <view class="order_item" v-for="item in orderList" :key="item.id">
<!-- 头部 --> <!-- 头部 -->
<view class="order_item_header"> <view class="order_item_header">
<view class="order_item_header_left"> <view class="order_item_header_left">
<up-image :src="item.shopLogo" width="22" height="22" bgColor="#f1f6ff00"></up-image> <up-image :src="item.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{item.shopName}}</view> <view class="order_product_title">{{item.shopName}}</view>
</view> </view>
<!-- 除开待付款 --> <!-- 除开待付款 -->
@@ -33,12 +33,13 @@
<!-- 待付款 --> <!-- 待付款 -->
<view v-else class="order_item_header_right order_right_due"> <view v-else class="order_item_header_right order_right_due">
<view class="order_right_due_msg">等待付款</view> <view class="order_right_due_msg">等待付款</view>
<view class="order_right_due_time">{{item.expireTime}}分钟</view> <view class="order_right_due_time">{{formatDate1(item.expireTime)}}前</view>
</view> </view>
</view> </view>
<!-- 产品详情 --> <!-- 产品详情 -->
<view class="order_item_content"> <view class="order_item_content">
<view v-for="pItem in item.items" :key="pItem.id" class="content_item"> <view v-for="pItem in item.items" :key="pItem.id" >
<view class="content_item" @click="jumpOrderInfo(item)">
<up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image> <up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="content_info"> <view class="content_info">
<view class="content_info_title">{{pItem.title}}</view> <view class="content_info_title">{{pItem.title}}</view>
@@ -54,15 +55,29 @@
<view class="content_right_quantity">x{{pItem.buyNum}}</view> <view class="content_right_quantity">x{{pItem.buyNum}}</view>
</view> </view>
</view> </view>
<view class="content_item_yd" v-if="pItem.expressNo">
<view>运单号:<text v-if="pItem.expressName">({{pItem.expressName}})</text>{{pItem.expressNo}}</view>
<view style="margin-left:10rpx;">
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(pItem.expressNo)"></up-image>
</view>
</view>
</view>
</view> </view>
<!-- 汇总 --> <!-- 汇总 -->
<view class="order_item_collect"> <view class="order_item_collect">
<view class="collect_msg">共{{item.buyNum}}件,合计¥{{item.sumAmount}}</view> <view class="collect_msg collect_msg_s" v-if="this.form.type === MINE_ORDER_TYPE.NOT_RECEIVE">
<view class="content_item_yd_msg">(快递动态跟进请复制单号至[快递100官网] 查询)</view>
<view>共{{item.buyNum}}件,合计¥{{item.sumAmount}}</view>
</view>
<view class="collect_msg" v-else>
共{{item.buyNum}}件,合计¥{{item.sumAmount}}
</view>
<view class="collect_operate"> <view class="collect_operate">
<view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.UNSHIPPED" @click="checkCancel(true)">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.UNPAID" @click="jumpOrderInfo">去付款</view> <view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.UNPAID" @click="jumpOrderInfo(item)">去付款</view>
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请退款</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.NOT_RECEIVE">确认收货</view> <view class="operate_comm operate_but_2" v-if="item.status === ORDER_TYPE.NOT_RECEIVE" @click="confirmReceiptOk(item)">确认收货</view>
<!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> --> <!-- <view class="operate_comm operate_but_3" v-if="item.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请售后</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.COMPLETED">申请售后</view> -->
<!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> --> <!-- <view class="operate_comm operate_but_1" v-if="item.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
@@ -76,7 +91,8 @@
<up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/not_order.png" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">暂无相关订单</view> <view class="not_order_msg_warp">暂无相关订单</view>
</view> </view>
</view> <view v-if="loading" style="text-align: center;">加载中...</view>
</scroll-view>
<up-popup v-model:show="cancelShow" :round="10" :closeOnClickOverlay="false"> <up-popup v-model:show="cancelShow" :round="10" :closeOnClickOverlay="false">
<view class="cancel_show_warp"> <view class="cancel_show_warp">
<view class="cancel_show_title_warp"> <view class="cancel_show_title_warp">
@@ -112,147 +128,75 @@
</view> </view>
</up-popup> </up-popup>
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
<!-- 暂未开放 -->
<up-modal :show="openShow" :showConfirmButton = "false">
<view class="slot-content">
<view class="close_warp" @click="openShow=false;">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view>
<view class="content_">
<view class="content_1">温馨提示</view>
<view class="content_2">暂未开放</view>
</view>
<view class="but_">
<view class="but_copy" @click="openShow=false;">确定</view>
</view>
</view>
</up-modal>
</view> </view>
</template> </template>
<script> <script>
import { ORDER_TYPE,ORDER_STATUS,getValue } from '@/utils/enumUtils.js'; import { MINE_ORDER_TYPE,ORDER_TYPE,ORDER_STATUS,getValue } from '@/utils/enumUtils.js';
import { ORDER_STATUS_CSS } from '@/utils/enumCssUtils.js'; import { ORDER_STATUS_CSS } from '@/utils/enumCssUtils.js';
import { getOrderList } from '@/api/order.js'; import { getOrderList,confirmReceipt } from '@/api/order.js';
import dayjs from 'dayjs';
import { formatDate1,copyData } from '@/utils/index.js'
export default { export default {
computed: { computed: {
ORDER_TYPE() { MINE_ORDER_TYPE() {
return ORDER_TYPE; return MINE_ORDER_TYPE;
}, },
ORDER_STATUS() { ORDER_STATUS() {
return ORDER_STATUS; return ORDER_STATUS;
}, },
ORDER_STATUS_CSS() { ORDER_STATUS_CSS() {
return ORDER_STATUS_CSS; return ORDER_STATUS_CSS;
},
ORDER_TYPE(){
return ORDER_TYPE;
} }
}, },
data() { data() {
return { return {
orderTypeList:[ orderTypeList:[
{ {
id:ORDER_TYPE.UNPAID, id:MINE_ORDER_TYPE.UNPAID,
title:"待支付", title:"待支付",
},{ },{
id:ORDER_TYPE.UNSHIPPED, id:MINE_ORDER_TYPE.UNSHIPPED,
title:"待发货", title:"待发货",
},{ },{
id:ORDER_TYPE.NOT_RECEIVE, id:MINE_ORDER_TYPE.NOT_RECEIVE,
title:"待收货", title:"待收货",
},{ },{
id:ORDER_TYPE.SUCCEED, id:MINE_ORDER_TYPE.SUCCEED,
title:"待评价", title:"已完成",
},
{
id:MINE_ORDER_TYPE.AFTER_SALE,
title:"售后",
}, },
], ],
form:{ form:{
search:null,//搜索 search:null,//搜索
page:1, page:1,
pageSize:15, pageSize:10,
type:0,// 选中的类型 type:MINE_ORDER_TYPE.UNPAID,// 选中的类型
}, },
orderList:[ hasMore: true, // 是否有更多数据可以加载
{ orderList:[],
id:1,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:1,
paymentTime:29,// 剩余付款时间,单位:分钟
product:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:3599,
},
{
id:2,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:2,
product:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
},{
id:2,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:7099.88,
},{
id:3,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:4,
product:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:3599,
},{
id:4,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:5,
product:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:3599,
},{
id:6,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:6,
product:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:3599,
},
],
cancelShow:false,// 取消订单 cancelShow:false,// 取消订单
reasonList:[ reasonList:[
{ {
@@ -279,15 +223,20 @@
reason:null, reason:null,
remark:null, remark:null,
}, },
loading: false, // 加载状态标志
openShow:false,
} }
}, },
onLoad(options) { onLoad(options) {
const type = options.type; const type = options.type;
this.form.type = type ? parseInt(type,10) : ORDER_TYPE.UNPAID; this.form.type = type && type < 5 ? parseInt(type,10) : MINE_ORDER_TYPE.UNPAID;
this.getOrderList(); this.loadData();
}, },
methods: { methods: {
dayjs,
getValue, getValue,
formatDate1,
copyData,
jumpLeft(){ jumpLeft(){
uni.switchTab({ uni.switchTab({
url: '/pages/mine/mine', url: '/pages/mine/mine',
@@ -297,24 +246,72 @@
console.log("searchFun",val); console.log("searchFun",val);
}, },
checkType(item){ checkType(item){
this.form.page = 1;
this.form.type = item.id; this.form.type = item.id;
this.getOrderList(); this.orderList = [];
if(item.id!==MINE_ORDER_TYPE.AFTER_SALE){
this.loadData();
}else{
this.openShow = true;// 未开发的弹框
}
}, },
jumpOrderInfo(){ jumpOrderInfo(item){
uni.navigateTo({ uni.navigateTo({
url:"/pages/mine_order_info/mine_order_info?type="+this.type, url:"/pages/mine_order_info/mine_order_info?id="+item.id,
}) })
}, },
async getOrderList(){ // 处理到期时间
const params = { handleExpressTime(expressTime){
...this.form, let resultM=0;
if(!expressTime || expressTime === 0){
return resultM;
} }
const resp = await getOrderList(params); const currentTimestamp = dayjs().unix();
console.log("resp",resp); const time = currentTimestamp - expressTime;
if(resp && resp.bizcode === 100){ resultM = dayjs(time).format('YYYY-MM-DD HH:MM:SS'); // 获取时分格式的字符串
this.orderList = resp.data;
// 如果需要将时分转换为分钟数(例如,'12:34'转换为754分钟),则需要额外计算:
// const [hours, minutes] = formattedTime.split(':').map(Number); // 分解小时和分钟为数字
// resultM = hours * 60 + minutes; // 计算总分钟数
// console.log(resultM); // 输出总分钟数,例如754
return resultM;
},
// 加载数据的方法
async loadData() {
if (this.loading) return; // 如果正在加载,则不重复加载
this.loading = true; // 设置加载状态为true
try {
// 模拟异步获取数据,实际应用中应该替换为你的数据获取逻辑,例如API调用
const newData = await this.fetchData(this.form.page, this.form.pageSize);
if(newData.entitys && newData.entitys.length !==0){
this.orderList = [...this.orderList, ...newData.entitys]; // 将新数据添加到列表中
this.form.page++; // 页码加1
}
} catch (error) {
console.error('加载数据失败:', error);
} finally {
this.loading = false; // 设置加载状态为false
} }
}, },
// 模拟获取数据的方法,实际应用中应该替换为你的数据获取逻辑,例如从服务器获取数据
async fetchData(page, pageSize) {
const params = {
...this.form,
page,
pageSize,
}
const data = await getOrderList(params);
if(data && data.bizcode === 100){
return data.data
}else{
return [];
}
},
// 当滚动到底部时触发的方法
loadMore() {
this.loadData(); // 加载更多数据
},
checkCancel(status){ checkCancel(status){
this.cancelShow = status; this.cancelShow = status;
if(!status){ if(!status){
@@ -324,7 +321,6 @@
} }
} }
}, },
/** /**
* 确认取消 * 确认取消
*/ */
@@ -339,8 +335,33 @@
}); });
return; return;
} }
console.log("params",params);
this.checkCancel(false); this.checkCancel(false);
},
/**
* 确认收货
*/
confirmReceiptOk(item){
const then = this;
uni.showModal({
title: '提示',
content: '是否确认收货?',
success: function (res) {
if (res.confirm) {
then.confirmReceiptFun(item);
}
}
});
},
async confirmReceiptFun(item){
const params = {
id:item.id,
}
const resp = await confirmReceipt(params);
if(resp && resp.bizcode === 100){
this.orderList = [];
this.form.page = 1;
this.loadData();
}
} }
} }
} }
@@ -374,8 +395,8 @@
} }
} }
.order_list_warp{ .order_list_warp{
height: calc(100vh - 270rpx); // height: calc(100vh - 270rpx);
overflow-y: auto; // overflow-y: auto;
} }
.order_item{ .order_item{
background: #FFFFFF; background: #FFFFFF;
@@ -428,6 +449,10 @@
color: #666666; color: #666666;
text-align: right; text-align: right;
} }
.collect_msg_s{
display: flex;
justify-content: space-between;
}
} }
} }
@@ -479,4 +504,17 @@
position: initial; position: initial;
width: 94%; width: 94%;
} }
.content_info_title{
width: 370rpx;
}
.content_item_yd{
font-weight: bold;
font-size: 24rpx;
display: flex;
align-items: center;
}
.content_item_yd_msg{
font-weight: bold;
font-size: 18rpx;
}
</style> </style>
+268 -110
View File
@@ -1,9 +1,17 @@
<template> <template>
<view class="mine_order_info_warp"> <view
class="mine_order_info_warp"
:style="{
'height': 'calc(100vh - '+height+')'
}"
>
<up-loading-page :loading="listLoading"></up-loading-page>
<view class="order_info_header"> <view class="order_info_header">
<up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00" @click="jumpLeft"></up-image> <up-image src="/static/common/left_b.png" width="20" height="19" bgColor="#f1f6ff00" @click="jumpLeft"></up-image>
<view class="header_status"> <view class="header_status">
<view style="margin-top: 10rpx;">
<up-image src="/static/common/order_status_1.png" width="20" height="19" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/order_status_1.png" width="20" height="19" bgColor="#f1f6ff00"></up-image>
</view>
<text class="msg">{{getValue(ORDER_STATUS,orderInfo.status)}}</text> <text class="msg">{{getValue(ORDER_STATUS,orderInfo.status)}}</text>
</view> </view>
</view> </view>
@@ -13,41 +21,41 @@
<view style=""> <view style="">
<text style="font-size: 28rpx;font-weight: bold;">需付款:</text> <text style="font-size: 28rpx;font-weight: bold;">需付款:</text>
<text style="font-size: 28rpx;">¥</text> <text style="font-size: 28rpx;">¥</text>
<text style="font-size: 36rpx;font-weight: bold;">234</text> <text style="font-size: 36rpx;font-weight: bold;">{{orderInfo.sumAmount}}</text>
<text style="font-size: 28rpx;">.00</text> <!-- <text style="font-size: 28rpx;">.00</text> -->
<text style="font-size: 20rpx;font-weight: bold;margin-left: 20rpx;">剩余</text> <text style="font-size: 20rpx;font-weight: bold;margin-left: 20rpx;">订单</text>
<text style="font-size: 28rpx;font-weight: bold;margin-left: 10rpx;">29:32:20</text> <text style="font-size: 28rpx;font-weight: bold;margin-left: 10rpx;">{{formatDate1(orderInfo.expireTime)}}</text>
<text style="font-size: 20rpx;font-weight: bold;">&nbsp;订单自动取消</text> <text style="font-size: 20rpx;font-weight: bold;">&nbsp;自动取消</text>
</view> </view>
<view class="payment_but"> <!-- <view class="payment_but">
<view class="but">去支付</view> <view class="but">去支付</view>
</view> </view> -->
</view> </view>
<view class="content_cancel" v-if="orderInfo.status === ORDER_TYPE.CANCELED">取消原因:超时未支付</view> <view class="content_cancel" v-if="orderInfo.status === ORDER_TYPE.CANCELED">取消原因:超时未支付</view>
<!-- 地址 --> <!-- 地址 -->
<view class="steps_warp"> <view class="steps_warp">
<!-- 物流单号 --> <!-- 物流单号 -->
<view class="address_info" v-if="[ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)"> <view class="address_info">
<view class="address_data_warp"> <view class="address_data_warp">
<up-image src="/static/common/waybill.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/waybill.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">运单号:</view> <view class="address_info_name">订单编号:</view>
<view class="address_info_mobile" style="margin-right: 20rpx;">{{orderInfo.waybillNumber}}</view> <view class="address_info_mobile" style="margin-right: 20rpx;">{{orderInfo.orderNum}}</view>
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(orderInfo.waybillNumber)"></up-image> <up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(orderInfo.orderNum)"></up-image>
</view> </view>
</view> </view>
<view class="address_info_right" v-if="[ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)">&nbsp;</view> <view class="address_info_right">&nbsp;</view>
<!-- 收货地址 --> <!-- 收货地址 -->
<view class="address_warp"> <view class="address_warp">
<view class="address_info"> <view class="address_info">
<view class="address_data_warp"> <view class="address_data_warp">
<up-image src="/static/common/address.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/address.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
<view class="address_info_name">{{orderInfo.name}}</view> <view class="address_info_name">{{orderInfo.name}}</view>
<view class="address_info_mobile">{{orderInfo.mobile}}</view> <view class="address_info_mobile">{{orderInfo.phone}}</view>
</view> </view>
<view class="address_but">修改地址</view> <!-- <view class="address_but">修改地址</view> -->
</view> </view>
<view class="address_content"> <view class="address_content">
{{orderInfo.address}} {{assembleAddress(orderInfo).names}} {{orderInfo.address}}
</view> </view>
</view> </view>
</view> </view>
@@ -56,16 +64,17 @@
<view class="order_comm order_product_warp"> <view class="order_comm order_product_warp">
<!-- 头部 --> <!-- 头部 -->
<view class="order_product_header"> <view class="order_product_header">
<up-image :src="orderInfo.product.url" width="22" height="22" bgColor="#f1f6ff00"></up-image> <up-image :src="orderInfo.shopLogo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{orderInfo.product.name}}</view> <view class="order_product_title">{{orderInfo.shopName}}</view>
</view> </view>
<!-- 产品详情 --> <!-- 产品详情 -->
<view class="order_item_content"> <view class="order_item_content">
<view v-for="pItem in orderInfo.product.productList" :key="pItem.id" class="content_item"> <view v-for="pItem in orderInfo.items" :key="pItem.id" >
<up-image :src="pItem.url" width="80" height="80" bgColor="#f1f6ff00"></up-image> <view class="content_item">
<up-image :src="pItem.mainGraph" width="80" height="80" bgColor="#f1f6ff00"></up-image>
<view class="content_info"> <view class="content_info">
<view class="content_info_title">{{pItem.title}}</view> <view class="content_info_title">{{pItem.title}}</view>
<view class="content_info_tag">{{pItem.tag.join(" ")}}</view> <view class="content_info_tag">{{pItem.goodsSpece}}</view>
<view> <view>
<text class="content_info_description" v-for="dItem in pItem.description" :key="dItem"> <text class="content_info_description" v-for="dItem in pItem.description" :key="dItem">
{{dItem}} {{dItem}}
@@ -73,71 +82,121 @@
</view> </view>
</view> </view>
<view class="content_right"> <view class="content_right">
<view class="content_right_total">¥{{pItem.total}}</view> <view class="content_right_total">¥{{pItem.goodsAmount}}</view>
<view class="content_right_quantity">x{{pItem.quantity}}</view> <view class="content_right_quantity">x{{pItem.buyNum}}</view>
</view>
</view>
<view class="content_other_item">
<view class="data_item data_item_yd" v-if="pItem.expressNo">
<view class="item_title">运单号:</view>
<view class="item_value">
<view>{{pItem.expressNo}} </view>
<view style="margin-left:10rpx;">
<up-image src="/static/common/copy.png" width="14" height="14" bgColor="#f1f6ff00" @click="copyData(pItem.expressNo)"></up-image>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view>
</view>
</view>
<!-- 金额等数据汇总 --> <!-- 金额等数据汇总 -->
<view class="order_comm order_data_warp"> <view class="order_comm order_data_warp">
<view class="data_item"> <view class="data_item">
<view class="item_title">商品总价</view> <view class="item_title">商品总价</view>
<view class="item_value">¥3599.00</view> <view class="item_value">¥{{orderInfo.sumAmount}}</view>
</view> </view>
<view class="data_item"> <view class="data_item">
<view class="item_title">快递运费</view> <view class="item_title">快递运费</view>
<view class="item_value">¥0.00</view> <view class="item_value">¥0.00</view>
</view> </view>
<view class="data_item"> <view class="data_item">
<view class="item_title">平台优惠<text class="copy_order_coupon">优惠券</text></view> <view class="item_title">平台优惠<text class="copy_order_coupon" v-if="orderInfo.coupon">优惠券</text></view>
<view class="item_value">-¥10.00</view> <view class="item_value">-¥0.00</view>
</view> </view>
<view class="data_item"> <view class="data_item">
<view class="item_title">应付款</view> <view class="item_title">应付款</view>
<view class="item_value pay_amount">¥3589.00</view> <view class="item_value pay_amount">¥{{orderInfo.sumAmount}}</view>
</view> </view>
<view class="order_data_but"></view> <view class="order_data_but"></view>
<view class="data_item">
<view class="item_title">订单编号</view>
<view class="item_value">2324124232424 <text class="copy_order_number" @click="copyData('2324124232424')">复制</text></view>
</view>
<view class="data_item"> <view class="data_item">
<view class="item_title">买家留言</view> <view class="item_title">买家留言</view>
<view class="item_value">快点发货~</view> <view class="item_value">{{orderInfo.remark}}</view>
</view> </view>
<view class="data_item"> <view class="data_item">
<view class="item_title">配送方式</view> <view class="item_title">配送方式</view>
<view class="item_value">普通快递</view> <view class="item_value">普通快递</view>
</view> </view>
<view class="data_item"> <!-- <view class="data_item">
<view class="item_title">支付方式</view> <view class="item_title">支付方式</view>
<view class="item_value">微信支付</view> <view class="item_value">微信支付</view>
</view> </view> -->
<view class="data_item"> <view class="data_item">
<view class="item_title">下单时间</view> <view class="item_title">下单时间</view>
<view class="item_value">2024-10-12 20:18:25</view> <view class="item_value">{{formatDate(orderInfo.ctdate)}}</view>
</view>
</view>
<!-- 支付方式 -->
<view class="order_way_warp" @click="wayShow = true;" v-if="orderInfo.status === ORDER_TYPE.UNPAID">
<view>支付方式</view>
<view class="order_way_right">
{{getValue(wayOption,wayForm.payway)}}
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
</view> </view>
<view class="collect_operate order_but_warp"> <view
<view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> class="collect_operate order_but_warp"
v-if="[ORDER_TYPE.UNPAID,ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)"
>
<!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">取消订单</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款</view> <view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.UNPAID" @click="goPay">去付款</view>
<view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请退款</view> -->
<view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE">确认收货</view> <view class="operate_comm operate_but_2" v-if="orderInfo.status === ORDER_TYPE.NOT_RECEIVE" @click="confirmReceiptOk(orderInfo)">确认收货</view>
<view class="operate_comm operate_but_3" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> <!-- <view class="operate_comm operate_but_3" v-if="orderInfo.status === ORDER_TYPE.UNSHIPPED">提醒发货</view> -->
<view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请售后</view> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.COMPLETED">申请售后</view> -->
<view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.AFTER_SALE">查看售后</view> <!-- <view class="operate_comm operate_but_1" v-if="orderInfo.status === ORDER_TYPE.AFTER_SALE">查看售后</view> -->
<view class="operate_comm operate_but_1" v-if="[ORDER_TYPE.COMPLETED].includes(orderInfo.status)">删除记录</view> <!-- <view class="operate_comm operate_but_1" v-if="[ORDER_TYPE.COMPLETED].includes(orderInfo.status)">删除记录</view> -->
<view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(orderInfo.status)">再次购买</view> <!-- <view class="operate_comm operate_but_3" v-if="[ORDER_TYPE.COMPLETED,ORDER_TYPE.CANCELED].includes(orderInfo.status)">再次购买</view> -->
</view> </view>
<!-- 选择支付方式 -->
<up-popup v-model:show="wayShow" :round="10" :closeOnClickOverlay="false" :closeable="true" :safeAreaInsetBottom="false">
<view class="way_popup_warp">
<view class="way_popup_title">支付方式</view>
<up-radio-group
v-model="wayForm.payway"
placement="column"
>
<view class="way_item" v-for="item in wayOption" :key="item.type">
<view class="way_item_">
<!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> -->
<view class="way_item_val">{{item.name}}<text v-if="item.balance">&nbsp;&nbsp;({{item.balance}})</text></view>
</view>
<up-radio
:name="item.type"
activeColor="#FF7C41"
>
</up-radio>
</view>
</up-radio-group>
<view class="popup_but" @click="wayShow = false;">
确认
</view>
</view>
</up-popup>
<up-toast ref="uToastRef"></up-toast>
</view> </view>
</template> </template>
<script> <script>
import { ORDER_TYPE,ORDER_STATUS,getValue } from '@/utils/enumUtils.js'; import { ORDER_TYPE,ORDER_STATUS,getValue } from '@/utils/enumUtils.js';
import { copyData } from '@/utils/index.js'; import { copyData,assembleAddress,formatDate,formatDate1 } from '@/utils/index.js';
import { getDetail,payment,getSupportPay,confirmReceipt } from '@/api/order.js';
import { appWxpayFun,zfbPayFun,jumpWayOk,jumpWayError } from '@/utils/payUtils.js'
export default { export default {
computed: { computed: {
@@ -149,68 +208,149 @@
}, },
ORDER_STATUS_CSS() { ORDER_STATUS_CSS() {
return ORDER_STATUS_CSS; return ORDER_STATUS_CSS;
} },
}, },
data() { data() {
return { return {
type:0, id:0,
orderInfo:{ orderInfo:{},
// status:ORDER_TYPE.UNPAID,// 待付款 listLoading:false,
// status:ORDER_TYPE.CANCELED,// 已取消 wayForm:{
// status:ORDER_TYPE.UNSHIPPED,// 待发货 id:0,
status:ORDER_TYPE.NOT_RECEIVE,// 待收货 payway:null,// 支付方式
// status:ORDER_TYPE.COMPLETED,// 完成
// status:ORDER_TYPE.AFTER_SALE,
name:"张先生",
mobile:"18****2848",
address:"河南省郑州市金水区东风路街道北三环索凌路交叉口明明小区1号楼1座",
waybillNumber:'SF23423443242',
product:{
id:1,
url:'/static/common/order_defal.png',
name:"哈希店铺",
status:1,
paymentTime:29,// 剩余付款时间,单位:分钟
productList:[
{
id:1,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
},{
id:2,
url:'/static/common/product_def.png',
title:'美的双开门冰箱大容量多美的双开门冰箱大容量多',
description:['双开门','大容量'],
tag:['7天无理由退货','退货险'],
quantity:1,
total:3599,
}
],
productTotal:7599,
}, },
}, wayShow:false,
wayOption:[],// 支付选项
height:'180rpx',
} }
}, },
onLoad(options) { onLoad(options) {
const type = options.type; const id = options.id;
this.type = type ? parseInt(type,10) : 0; this.id = id ? parseInt(id,10) : 0;
this.getOrderInfo();
this.getWayOption();
}, },
methods: { methods: {
getValue, getValue,
copyData, copyData,
assembleAddress,
formatDate,
formatDate1,
jumpLeft(){ jumpLeft(){
uni.navigateTo({ uni.navigateTo({
url:"/pages/mine_order/mine_order?type="+this.type, url:"/pages/mine_order/mine_order?type="+this.orderInfo.status,
}) })
}, },
async getWayOption(){
const result = await getSupportPay();
if(result && result.bizcode === 100){
this.wayOption = result.data;
}
},
// 查询订单详情
async getOrderInfo(){
this.listLoading = true;
const params={
id:this.id,
}
const result = await getDetail(params);
if(result && result.bizcode === 100){
const orderInfo = result.data;
if([ORDER_TYPE.UNPAID,ORDER_TYPE.NOT_RECEIVE].includes(orderInfo.status)){
this.height = '180rpx';
}else{
this.height = '0rpx';
}
this.orderInfo = orderInfo;
}
this.listLoading = false;
},
// 去支付 // 去支付
goPay(){ async goPay(){
console.log("goPay.....") const payway = this.wayForm.payway;
if(!payway || payway === 0){
this.$refs.uToastRef.show({
type: 'error',
message: "请先选择支付方式",
});
return;
}
const params={
id:this.orderInfo.id,
payway,
}
const resp = await payment(params);
// 提交订单成功,就唤起支付
if(resp && resp.bizcode === 100){
const item = resp.data;
if(item.status === 1){
jumpWayOk();
return;
}
if(item.wechat && Object.keys(item.wechat).length !==0){
this.appWxpay(item.wechat,item.orderId,item.orderNum);
}else if(item.alipay && Object.keys(item.alipay).length !==0 && item.alipay){
this.zfbPay(item.alipay,item.orderId,item.orderNum);
}else{
this.$refs.uToastRef.show({
type: 'error',
message: "订单支付失败",
});
setTimeout(()=>{
jumpWayError()
},2000)
}
}else{
this.getOrderInfo();
}
},
// app 微信支付
async appWxpay(alipay,orderId,orderNum){
try {
const result = await appWxpayFun(alipay,orderId,orderNum);
console.log('支付成功', result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
console.error('支付失败', error);
// 处理支付失败后的逻辑,如提示用户等
}
},
// 支付宝支付
async zfbPay(alipay,orderId,orderNum){
try {
const result = await zfbPayFun(alipay,orderId,orderNum);
console.log('支付成功', result);
// 处理支付成功后的逻辑,如更新订单状态等
} catch (error) {
console.error('支付失败', error);
// 处理支付失败后的逻辑,如提示用户等
}
},
/**
* 确认收货
*/
confirmReceiptOk(item){
const then = this;
uni.showModal({
title: '提示',
content: '是否确认收货?',
success: function (res) {
if (res.confirm) {
then.confirmReceiptFun(item);
}
}
});
},
async confirmReceiptFun(item){
const params = {
id:item.id,
}
const resp = await confirmReceipt(params);
if(resp && resp.bizcode === 100){
this.orderList = [];
this.form.page = 1;
this.loadData();
}
} }
} }
} }
@@ -218,7 +358,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.mine_order_info_warp{ .mine_order_info_warp{
height: calc(100vh - 180rpx); // height: calc(100vh - 180rpx);
background-color: $app-bj; background-color: $app-bj;
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;
@@ -247,7 +387,7 @@
.order_info_content{ .order_info_content{
position: absolute; position: absolute;
top: 184rpx; top: 184rpx;
width: 100%; width: calc(100% - 40rpx);
padding: 0 20rpx; padding: 0 20rpx;
.content_due{ .content_due{
display: grid; display: grid;
@@ -280,13 +420,13 @@
background: #FFFFFF; background: #FFFFFF;
border-radius: 24rpx; border-radius: 24rpx;
padding: 20rpx; padding: 20rpx;
width: calc(100% - 80rpx); width: calc(100% - 40rpx);
margin-top: 66rpx; margin-top: 66rpx;
.address_info_right{ .address_info_right{
border-left: 1rpx dashed #99999959; border-left: 1rpx dashed #99999959;
height: 26rpx; height: 14rpx;
width: 10rpx; width: 10rpx;
margin: 20rpx; margin: 10rpx 20rpx;
} }
.address_warp{ .address_warp{
} }
@@ -329,11 +469,12 @@
border-radius: 20rpx; border-radius: 20rpx;
padding: 30rpx; padding: 30rpx;
margin-top: 30rpx; margin-top: 30rpx;
width: calc(100% - 96rpx); width: calc(100% - 60rpx);
} }
.order_product_warp{ .order_product_warp{
.order_product_header{ .order_product_header{
display: flex; display: flex;
align-items: center;
} }
.order_product_title{ .order_product_title{
font-weight: bold; font-weight: bold;
@@ -345,19 +486,8 @@
.order_data_warp{ .order_data_warp{
margin-bottom: 20rpx; margin-bottom: 20rpx;
.data_item{
display: flex;
justify-content: space-between;
line-height: 60rpx;
font-weight: bold;
font-size: 24rpx;
}
.item_title{
color: #808080;
}
.item_value{
color: #1A1A1A;
}
.pay_amount{ .pay_amount{
color: $app-bt-bj; color: $app-bt-bj;
} }
@@ -396,4 +526,32 @@
height: 34rpx; height: 34rpx;
} }
} }
.content_other_item{
margin-top: 20rpx;
}
.data_item{
display: flex;
justify-content: space-between;
line-height: 60rpx;
font-weight: bold;
font-size: 24rpx;
}
.item_title{
color: #808080;
}
.item_value{
color: #1A1A1A;
display: flex;
}
.order_way_warp{
margin-bottom: 60rpx;
width: calc(100% - 60rpx);
}
.content_info_title{
width: 370rpx;
}
.data_item_yd{
display: flex;
justify-content: left;
}
</style> </style>
File diff suppressed because one or more lines are too long
+7 -2
View File
@@ -9,7 +9,7 @@
<text style="font-size: 40rpx;">84</text> <text style="font-size: 40rpx;">84</text>
</view> </view>
</view> </view>
<view class="header_but">提现</view> <view class="header_but" @click="jumpWithdraw">提现</view>
</view> </view>
<view class="mine_purse_bonus_content"> <view class="mine_purse_bonus_content">
<view class="title">财务明细</view> <view class="title">财务明细</view>
@@ -77,7 +77,12 @@
} }
}, },
methods: { methods: {
// 提现
jumpWithdraw(){
uni.navigateTo({
url:"/pages/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw",
})
}
} }
} }
</script> </script>
+131 -177
View File
@@ -1,5 +1,6 @@
<template> <template>
<view class="order_submit_warp"> <view class="order_submit_warp">
<Header :leftTitle="$t('order.submit.title')" leftPathType="switchTab" leftPath="/pages/shopping_cart/shopping_cart"/>
<!-- 收件人信息 --> <!-- 收件人信息 -->
<view class="order_submit_header_warp" @click="checkAddressShow(true,'data')" v-if="orderInfo.address && Object.keys(orderInfo.address).length !==0"> <view class="order_submit_header_warp" @click="checkAddressShow(true,'data')" v-if="orderInfo.address && Object.keys(orderInfo.address).length !==0">
<view class="header_areaAddress_warp"> <view class="header_areaAddress_warp">
@@ -20,15 +21,17 @@
<view v-else class="no_address" @click="checkAddressShow(true,'data')"> <view v-else class="no_address" @click="checkAddressShow(true,'data')">
<view class="no_address_title"> <view class="no_address_title">
<view>请填写地址</view> <view>请填写地址</view>
<view style="margin-top: 10rpx;">
<up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right.png" width="14" height="14" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view>
<view class="no_address_msg">您还未添加收货地址,请完善地址!</view> <view class="no_address_msg">您还未添加收货地址,请完善地址!</view>
</view> </view>
<!-- 店铺信息 --> <!-- 店铺信息 -->
<view class="order_store_warp order_product_warp" v-for="(item,index) in orderInfo.shops" :key="item.id"> <view class="order_store_warp order_product_warp" v-for="(item,index) in orderInfo.shops" :key="item.id">
<!-- 头部 --> <!-- 头部 -->
<view class="order_product_header"> <view class="order_product_header">
<up-image :src="item.logo" width="22" height="22" bgColor="#f1f6ff00"></up-image> <up-image :src="item.logo" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{item.name}}</view> <view class="order_product_title">{{item.name}}</view>
</view> </view>
<view v-for="(addItem,addIndex) in item.addrTimes" :key="addIndex"> <view v-for="(addItem,addIndex) in item.addrTimes" :key="addIndex">
@@ -44,9 +47,9 @@
</view> </view>
<!-- 产品详情 --> <!-- 产品详情 -->
<view class="order_item_content" v-for="(pItem,pIndex) in addItem.goods" :key="pItem.id"> <view class="order_item_content" v-for="(pItem,pIndex) in addItem.goods" :key="pItem.id">
<up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00"></up-image> <up-image :src="pItem.img" width="80" height="80" bgColor="#f1f6ff00" @click="jumpProductInfo(pItem)"></up-image>
<view class="content_info_right"> <view class="content_info_right">
<view> <view class="content_info_left_total" @click="jumpProductInfo(pItem)">
<view class="content_info_title">{{pItem.title}}</view> <view class="content_info_title">{{pItem.title}}</view>
<view class="content_info_tag">{{pItem.specs}}</view> <view class="content_info_tag">{{pItem.specs}}</view>
</view> </view>
@@ -98,7 +101,7 @@
<view class="order_way_warp" @click="wayShow = true;"> <view class="order_way_warp" @click="wayShow = true;">
<view>支付方式</view> <view>支付方式</view>
<view class="order_way_right"> <view class="order_way_right">
{{getValue(PAYMENT_WAY_,orderInfo.paymentMethod)}} {{getValue(wayOption,orderInfo.paymentMethod)}}
<up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/right.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
@@ -116,14 +119,13 @@
v-model="orderInfo.paymentMethod" v-model="orderInfo.paymentMethod"
placement="column" placement="column"
> >
<view class="way_item" v-for="item in wayList" :key="item.id"> <view class="way_item" v-for="item in wayOption" :key="item.id">
<view class="way_item_"> <view class="way_item_">
<view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> <!-- <view style="margin-top: 2rpx;"><up-image :src="item.path" width="20" height="20" bgColor="#f1f6ff00"></up-image></view> -->
<view class="way_item_val">{{item.name}}</view> <view class="way_item_val">{{item.name}}<text v-if="item.balance">&nbsp;&nbsp;({{item.balance}})</text></view>
</view> </view>
<up-radio <up-radio
:name="item.id" :name="item.type"
:disabled="item.disabled"
activeColor="#FF7C41" activeColor="#FF7C41"
> >
</up-radio> </up-radio>
@@ -140,6 +142,7 @@
<view class="address_popup_warp"> <view class="address_popup_warp">
<view class="address_popup_title">收件地址</view> <view class="address_popup_title">收件地址</view>
<view class="address_popup_content"> <view class="address_popup_content">
<view class="address_popup_content_add" @click="addAdress"> + 新增地址</view>
<Address @valueFunc="getAddressValueFunc"/> <Address @valueFunc="getAddressValueFunc"/>
</view> </view>
<view class="popup_but" @click="addressOk"> <view class="popup_but" @click="addressOk">
@@ -154,65 +157,87 @@
<script> <script>
import Address from '@/components/address.vue'; import Address from '@/components/address.vue';
import { PAYMENT_WAY,PAYMENT_WAY_,PRODUCT_DELIVERY_TIME,getValue } from '@/utils/enumUtils.js'; import { PAYMENT_WAY,PAYMENT_WAY_,PRODUCT_DELIVERY_TIME,getValue,WAY_LIST } from '@/utils/enumUtils.js';
import { getSettleList,settle } from '@/api/cart.js' import { getSettleList,settle,updateGoodsNum } from '@/api/cart.js';
import { getSupportPay } from '@/api/order.js';
import { feedback } from '@/api/payment.js'; import { feedback } from '@/api/payment.js';
import { assembleAddress } from '@/utils/index.js' import { assembleAddress } from '@/utils/index.js'
import Header from '@/components/header.vue';
import { appWxpayFun,zfbPayFun,jumpWayOk,jumpWayError } from '@/utils/payUtils.js'
export default { export default {
computed: { computed: {
PAYMENT_WAY_() {
return PAYMENT_WAY_;
},
PRODUCT_DELIVERY_TIME() { PRODUCT_DELIVERY_TIME() {
return PRODUCT_DELIVERY_TIME; return PRODUCT_DELIVERY_TIME;
} },
}, },
components: { components: {
Address, Address,
}, Header,
onLoad(option) {
const ids = option.ids;
if(ids){
this.ids = ids;
this.getOrder();
}
}, },
data() { data() {
return { return {
ids:0, ids:0,
orderInfo:{ orderInfo:{
// coupon:2,//优惠卷 // coupon:2,//优惠卷
paymentMethod:null,// 支付方式 paymentMethod:PAYMENT_WAY.ALIPAY,// 支付方式,暂时默认用支付宝
total:4000,// 需要支付的总金额 total:4000,// 需要支付的总金额
address:{},// 选中的地址 address:{},// 选中的地址
store:[], store:[],
}, },
wayList:[
{
disabled:false,
id:PAYMENT_WAY.WECHAT,
name:"微信支付",
path:"/static/product/way_wx.png",
},
{
disabled:false,
id:PAYMENT_WAY.ALIPAY,
name:"支付宝支付",
path:"/static/product/way_zfb.png",
},
],
wayShow:false, wayShow:false,
addressShow:false,// 收件地址选择 addressShow:false,// 收件地址选择
addressType:'',// 收件地址数据类型 addressType:'',// 收件地址数据类型
addressIndex:0,// 收件地址数据类型 addressIndex:0,// 收件地址数据类型
shopsIndex:0,// 收件地址数据类型 shopsIndex:0,// 收件地址数据类型
selectAddress:{},// 收件地址选择 selectAddress:{},// 收件地址选择
wayOption:[],
// leftPath:'',
// leftPathType:'',
}; };
}, },
onLoad(option) {
const ids = option.ids;
console.log("ids",ids);
if(ids && ids!=="null"){
this.ids = ids;
this.getOrder();
// const idsArr = ids.split(",");
// console.log("idsArr.length",idsArr.length);
// if(idsArr.length >1){
// this.leftPath = "/pages/sort/sort";
// this.leftPathType = "switchTab"
// }else{
// this.leftPath = "/pages/productInfo/productInfo?id="+ids;
// this.leftPathType = "navigateTo"
// }
}
const addressShow = option.addressShow;
if(addressShow && addressShow !=="null"){
this.addressShow = addressShow;
}
},
mounted() {
this.getWayOption();
},
methods: { methods: {
getValue, getValue,
assembleAddress, assembleAddress,
// 增加收货地址
addAdress(){
const ids = this.ids;
// addressShow = true;
uni.navigateTo({
url:"/pages/mine_address_add/mine_address_add?ids="+ids,
})
},
async getWayOption(){
const result = await getSupportPay();
if(result && result.bizcode === 100){
this.wayOption = result.data;
}
},
async getOrder(){ async getOrder(){
const ids = this.ids; const ids = this.ids;
if(!ids || ids ===0){ if(!ids || ids ===0){
@@ -253,28 +278,43 @@
* @param {Object} addIndex 需要修改店铺的数据节点 * @param {Object} addIndex 需要修改店铺的数据节点
* @param {Object} index 需要修改的数据节点 * @param {Object} index 需要修改的数据节点
*/ */
quantityFun(type,index,addIndex,pIndex){ async quantityFun(type,index,addIndex,pIndex){
let currentQuantity = this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num;// 当前数量 const data = this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex];
let currentQuantity = Number(data.num);// 当前数量
let currentTotalPrice = Number(data.totalPrice);// 当前金额
let currentAmount = Number(this.orderInfo.amount);// 总金额
if(type === "minus"){ if(type === "minus"){
if(currentQuantity === 1){ if(currentQuantity === 1){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "不能再减拉,不能小于最低购买数量~", message: "不能再减拉,不能小于最低购买数量~",
}); });x3
}else{ }else{
currentQuantity = currentQuantity - 1; currentQuantity = currentQuantity - 1;
currentAmount = currentAmount - data.unitPrice;
currentTotalPrice = currentTotalPrice - data.unitPrice;
} }
}else if(type === "add"){ }else if(type === "add"){
// 需要判断一下库存 // 需要判断一下库存
currentQuantity = currentQuantity + 1; currentQuantity = currentQuantity + 1;
currentAmount = currentAmount + data.unitPrice;
currentTotalPrice = currentTotalPrice + data.unitPrice;
} }
const params={
id:data.id,
goodsNum:currentQuantity,
}
const result = await updateGoodsNum(params);
if(result && result.bizcode === 100){
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num = currentQuantity; this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].num = currentQuantity;
this.orderInfo.shops[index].addrTimes[addIndex].goods[pIndex].totalPrice = currentTotalPrice.toFixed(2);
this.orderInfo.amount = currentAmount.toFixed(2);
}
}, },
// 获取备注 // 获取备注
getRemark(){ getRemark(){
const orderInfo = this.orderInfo; const orderInfo = this.orderInfo;
console.log("orderInfo",orderInfo);
const remarkArr = []; const remarkArr = [];
if(orderInfo && Object.keys(orderInfo).length!==0){ if(orderInfo && Object.keys(orderInfo).length!==0){
const remarObj={}; const remarObj={};
@@ -292,7 +332,6 @@
} }
remarkArr.push(remarObj); remarkArr.push(remarObj);
} }
console.log("remarkArr",remarkArr);
return remarkArr; return remarkArr;
}, },
/** /**
@@ -300,6 +339,15 @@
*/ */
async goPay(){ async goPay(){
const orderInfo = this.orderInfo; const orderInfo = this.orderInfo;
if(!orderInfo.address || Object.keys(orderInfo.address).length === 0){
this.$refs.uToastRef.show({
type: 'error',
message: "请选择收货地址",
});
return;
}
const way = orderInfo.paymentMethod; const way = orderInfo.paymentMethod;
if(!way || way === 0){ if(!way || way === 0){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
@@ -308,6 +356,7 @@
}); });
return; return;
} }
const params={ const params={
addrId:orderInfo.address.id,// 收货地址ID addrId:orderInfo.address.id,// 收货地址ID
cartIds:this.ids,//结算的购物车ID,多个以逗号分割,ALL表示全选 cartIds:this.ids,//结算的购物车ID,多个以逗号分割,ALL表示全选
@@ -319,93 +368,48 @@
// 提交订单成功,就唤起支付 // 提交订单成功,就唤起支付
if(resp && resp.bizcode === 100){ if(resp && resp.bizcode === 100){
const item = resp.data; const item = resp.data;
if(params.payway === PAYMENT_WAY.WECHAT){// APP微信支付 if(item.status === 1){
jumpWayOk();
return;
}
if(item.wechat && Object.keys(item.wechat).length !==0){ if(item.wechat && Object.keys(item.wechat).length !==0){
this.appWxpay(item.wechat); this.appWxpay(item.wechat,item.orderId,item.orderNum);
}else if(item.alipay && Object.keys(item.alipay).length !==0 && item.alipay){
this.zfbPay(item.alipay,item.orderId,item.orderNum);
}else{ }else{
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'error', type: 'error',
message: "订单支付失败", message: "订单支付失败",
}); });
setTimeout(()=>{
jumpWayError()
},2000)
} }
}else if(params.payway === PAYMENT_WAY.ALIPAY){// 支付宝支付
if(item.alipay && Object.keys(item.alipay).length !==0){
this.zfbPay(item.alipay);
}else{ }else{
this.$refs.uToastRef.show({ this.getOrder();
type: 'error',
message: "订单支付失败",
});
}
}
} }
}, },
// app 微信支付 // app 微信支付
appWxpay(item){ async appWxpay(alipay,orderId,orderNum){
const newThis = this; try {
const orderInfo = { const result = await appWxpayFun(alipay,orderId,orderNum);
"appid": item.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致 console.log('支付成功', result);
"noncestr": item.nonceStr, // 随机字符串 // 处理支付成功后的逻辑,如更新订单状态等
"package": "Sign=WXPay", // 固定值 } catch (error) {
"partnerid": item.partnerId, // 微信支付商户号 console.error('支付失败', error);
"prepayid": item.prepayId, // 统一下单订单号 // 处理支付失败后的逻辑,如提示用户等
"timestamp": item.timeStamp, // 时间戳(单位:秒)
"sign": item.sign // 签名,这里用的 MD5/RSA 签名
};
uni.requestPayment({
provider:"wxpay",
orderInfo: orderInfo,
success: function(res) {
console.log('success:' + res);
newThis.payFeedbackFun(item.orderId,res.orderNum,1);
newThis.jumpWayOk();
},
fail: function(err) {
console.log('fail:',err);
this.$refs.uToastRef.show({
type: 'error',
message: "支付失败",
});
} }
});
}, },
// 支付宝支付 // 支付宝支付
zfbPay(item){ async zfbPay(alipay,orderId,orderNum){
const that = this; try {
uni.requestPayment({ const result = await zfbPayFun(alipay,orderId,orderNum);
provider: 'alipay', console.log('支付成功', result);
orderInfo: item.orderStr, // 处理支付成功后的逻辑,如更新订单状态等
success(res) { } catch (error) {
console.log("res",res); console.error('支付失败', error);
that.payFeedbackFun(item.orderId,item.orderNum,1); // 处理支付失败后的逻辑,如提示用户等
that.jumpWayOk();
},
//调用失败的回调
fail(err) {
console.log('fail:',err);
this.$refs.uToastRef.show({
type: 'error',
message: "支付失败",
});
} }
})
},
// 跳转到支付成功页面
jumpWayOk(){
uni.navigateTo({
url:"/pages/order_submit_ok/order_submit_ok",
})
},
// 支付结果回调
async payFeedbackFun(orderId,orderNum,status){
const params = {
orderId,
orderNum,
status,
}
console.log("params",params);
const response = await feedback(params);
console.log("反馈结果",response);
}, },
// 地址选中 // 地址选中
getAddressValueFunc(item){ getAddressValueFunc(item){
@@ -431,6 +435,12 @@
this.addressType = type; this.addressType = type;
this.addressIndex = addIndex; this.addressIndex = addIndex;
this.shopsIndex = index; this.shopsIndex = index;
},
jumpProductInfo(item){
console.log("item",item);
uni.navigateTo({
url:"/pages/productInfo/productInfo?id="+item.goodsId,
})
} }
} }
} }
@@ -538,12 +548,16 @@
} }
.order_item_content{ .order_item_content{
display: flex; display: flex;
margin-top: 20rpx;
.content_info_right{ .content_info_right{
margin-left: 20rpx; margin-left: 20rpx;
display: grid; display: grid;
width: calc(100% - 160rpx);
}
.content_info_left_total{
} }
.content_info_title { .content_info_title {
width: 266px; width: 460rpx;
} }
.content_info_tag{ .content_info_tag{
font-size: 20rpx; font-size: 20rpx;
@@ -600,21 +614,7 @@
} }
} }
.order_way_warp{
display: flex;
justify-content: space-between;
align-items: center;
background: #FFFFFF;
border-radius: 24rpx;
margin-top: 30rpx;
padding: 30rpx;
font-weight: 500;
font-size: 26rpx;
color: #222222;
.order_way_right{
display: flex;
}
}
.order_pay_but{ .order_pay_but{
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@@ -637,54 +637,8 @@
font-size: 36rpx; font-size: 36rpx;
color: $app-bt-bj; color: $app-bt-bj;
} }
}
.way_popup_warp{
padding: 30rpx;
min-height: 800rpx;
width: calc(100% - 60rpx);
.way_popup_title{
text-align: center;
margin-bottom: 60rpx;
}
.way_item{
display: flex;
justify-content: space-between;
line-height: 82rpx;
.way_item_{
display: flex;
align-items: center;
}
.way_item_val{
font-weight: bold;
font-size: 30rpx;
color: #222222;
margin-left: 20rpx;
}
}
} }
.popup_but{
position: fixed;
bottom: 64rpx;
background: $app-bt-bj;
border-radius: 16rpx;
color: #FFFFFF;
text-align: center;
padding: 20rpx 0;
width: calc(100% - 60rpx);
}
.address_popup_warp{
padding: 30rpx;
height: 1200rpx;
overflow-y: hidden;
.address_popup_title{
text-align: center;
margin-bottom: 20rpx;
}
.address_popup_content{
height: calc(100% - 180rpx);
overflow-y: auto;
}
}
</style> </style>
@@ -1,15 +1,21 @@
<template> <template>
<view class="order_sumbit_ok_warp"> <view class="order_sumbit_ok_warp">
<Header leftTitle="" left-path-type="switchTab" left-path="/pages/mine/mine"/>
<view class="order_sumbit_ok_content_warp">
<view class="ok_img"> <view class="ok_img">
<up-image src="/static/product/ok.png" width="120" height="120" bgColor="#f1f6ff00"></up-image> <up-image src="/static/product/ok.png" width="120" height="120" bgColor="#f1f6ff00"></up-image>
<view class="ok_img_msg">支付成功</view> <view class="ok_img_msg">支付成功</view>
</view> </view>
<view class="ok_but" @click="jumpHome">确认</view> <view class="ok_but" @click="jumpHome">确认</view>
</view> </view>
</view>
</template> </template>
<script> <script>
import Header from '@/components/header.vue';
export default { export default {
components:{Header},
data() { data() {
return { return {
@@ -29,7 +35,10 @@
.order_sumbit_ok_warp{ .order_sumbit_ok_warp{
height: calc(100vh - 80rpx); height: calc(100vh - 80rpx);
text-align: center; text-align: center;
.order_sumbit_ok_content_warp{
padding: 40rpx; padding: 40rpx;
}
.ok_img{ .ok_img{
display: grid; display: grid;
.ok_img_msg{ .ok_img_msg{
File diff suppressed because one or more lines are too long
+25 -16
View File
@@ -5,6 +5,7 @@
<up-swiper <up-swiper
:list="swiperList" :list="swiperList"
height="280" height="280"
@change="e => currentNum = e.current"
> >
<template #indicator> <template #indicator>
<view <view
@@ -27,7 +28,9 @@
<view class="content_data"> <view class="content_data">
<view class="content_data_price"> <view class="content_data_price">
<text>¥</text> <text>¥</text>
<text style="font-size: 60rpx;" v-if="orderInfo.maxPrice && orderInfo.maxPrice !==0">{{orderInfo.minPrice}} - {{orderInfo.maxPrice}}</text> <text style="font-size: 60rpx;" v-if="orderInfo.minPrice && orderInfo.maxPrice">
{{orderInfo.minPrice}} - {{orderInfo.maxPrice}}
</text>
<text style="font-size: 60rpx;" v-else>{{orderInfo.minPrice}}</text> <text style="font-size: 60rpx;" v-else>{{orderInfo.minPrice}}</text>
<text class="price_o">¥{{orderInfo.adPrice}}</text> <text class="price_o">¥{{orderInfo.adPrice}}</text>
</view> </view>
@@ -119,6 +122,7 @@
:round="10" :round="10"
:closeOnClickOverlay="false" :closeOnClickOverlay="false"
:closeable="true" :closeable="true"
@close="specificationShow=false"
mode="bottom" mode="bottom"
> >
<view class="specification_warp"> <view class="specification_warp">
@@ -146,7 +150,8 @@
{{selectSpecificationTempl.price}} {{selectSpecificationTempl.price}}
</text> </text>
<view style="font-size: 50rpx" v-else> <view style="font-size: 50rpx" v-else>
{{orderInfo.minPrice}} - {{orderInfo.maxPrice}} {{orderInfo.minPrice}}
<text v-if="orderInfo.maxPrice">- {{orderInfo.maxPrice}}</text>
</view> </view>
<view class="price_content_coupon_warp" v-if="orderInfo.couponPrice && orderInfo.couponPrice !==0">优惠卷{{orderInfo.couponPrice}}</view> <view class="price_content_coupon_warp" v-if="orderInfo.couponPrice && orderInfo.couponPrice !==0">优惠卷{{orderInfo.couponPrice}}</view>
</view> </view>
@@ -186,11 +191,11 @@
<view class="quantity_but" @click="quantityFun('add')">+</view> <view class="quantity_but" @click="quantityFun('add')">+</view>
</view> </view>
</view> </view>
<view v-if="specificationShowType === 'buy'" class="specification_buy_but" @click="byFun">去支付</view> <view v-if="specificationShowType === 'buy'" class="specification_buy_but" @click="addCart(true)">去支付</view>
<view v-else-if="specificationShowType === 'addCart'" class="specification_buy_but" @click="addCart">加入购物车</view> <view v-else-if="specificationShowType === 'addCart'" class="specification_buy_but" @click="addCart(false)">加入购物车</view>
<view v-else class="product_but_right popup_but"> <view v-else class="product_but_right popup_but">
<view class ='but_comm join_warp' @click="addCart">加入购物车</view> <view class ='but_comm join_warp' @click="addCart(false)">加入购物车</view>
<view class="but_comm buy_warp" @click="byFun">立即购买</view> <view class="but_comm buy_warp" @click="addCart(true)">立即购买</view>
</view> </view>
</view> </view>
</view> </view>
@@ -213,7 +218,7 @@
return { return {
id:0, id:0,
swiperList:[], swiperList:[],
currentNum:1, currentNum:0,
specificationShow:false, specificationShow:false,
specificationShowType:'',// 弹框类型 specificationShowType:'',// 弹框类型
orderInfo:{}, orderInfo:{},
@@ -369,16 +374,9 @@
} }
this.orderInfo.quantity = currentQuantity; this.orderInfo.quantity = currentQuantity;
}, },
// 立即购买,确定订单页面
byFun(){
// 先加入购物车,再去购买
this.addCart();
uni.navigateTo({
url: '/pages/order_submit/order_submit',
})
},
// 加入购入车 // 加入购入车
async addCart(){ async addCart(isBy = false){
const selectTempl = this.selectSpecificationTempl; const selectTempl = this.selectSpecificationTempl;
if(!selectTempl || Object.keys(selectTempl).length ===0){ if(!selectTempl || Object.keys(selectTempl).length ===0){
uni.showToast({ uni.showToast({
@@ -395,15 +393,25 @@
} }
const resp = await addGoods(params); const resp = await addGoods(params);
if(resp && resp.bizcode === 100){ if(resp && resp.bizcode === 100){
if(isBy){
uni.navigateTo({
url: '/pages/order_submit/order_submit?ids='+resp.data,
})
}else{
uni.showToast({ uni.showToast({
title: '成功加入购物车', title: '成功加入购物车',
icon: 'success', // 可选 success/loading/none icon: 'success', // 可选 success/loading/none
duration: 2000 // 持续时长,单位ms duration: 2000 // 持续时长,单位ms
}); });
}
setTimeout(()=>{ setTimeout(()=>{
this.checkSpecification(false,null); this.checkSpecification(false,null);
},2000) },2000)
} }
},
// 跳转到分享页面
jumpShare(){
} }
} }
@@ -720,6 +728,7 @@
} }
.popup_but{ .popup_but{
background-color: #FFFFFF;
.but_comm{ .but_comm{
width: 40%; width: 40%;
} }
+25 -4
View File
@@ -95,9 +95,11 @@
> >
<template #label> <template #label>
<text>已阅读并同意</text> <text>已阅读并同意</text>
<text class="policy_a_warp">《哈希优品服务协议》</text> <text class="policy_a_warp" @click="jumpUserAgreement">《服务协议》</text>
<text>及</text> <text>、</text>
<text class="policy_a_warp">《隐私政策》</text> <text class="policy_a_warp" @click="jumpPrivacyAgreement">《隐私政策》</text>
<text>、</text>
<text class="policy_a_warp" @click="jumpProductAgreement">《售后保障协议》</text>
</template> </template>
</up-checkbox> </up-checkbox>
</view> </view>
@@ -110,6 +112,7 @@
import { getUserList } from '@/api/common.js'; import { getUserList } from '@/api/common.js';
import { register } from '@/api/auth.js'; import { register } from '@/api/auth.js';
import { setStorageFun,TOKEN_NAME,USER_KEY,USER_DATA,USER_LOGIN_TIME } from '@/utils/auth.js'; import { setStorageFun,TOKEN_NAME,USER_KEY,USER_DATA,USER_LOGIN_TIME } from '@/utils/auth.js';
import CryptoJS from 'crypto-js';
export default { export default {
data() { data() {
@@ -193,7 +196,7 @@
const params = { const params = {
mobile:form.mobile, mobile:form.mobile,
smsCode:form.smsCode, smsCode:form.smsCode,
password:form.loginPassword, password:CryptoJS.MD5(form.loginPassword).toString(),
inviteCode:form.referralCode, inviteCode:form.referralCode,
} }
const resp = await register(params); const resp = await register(params);
@@ -254,6 +257,24 @@
this.countdown = false; this.countdown = false;
} }
}, },
// 用户协议
jumpUserAgreement(){
uni.navigateTo({
url: '/pages/mine_user_agreement/mine_user_agreement?backPath=register'
})
},
// 隐私协议
jumpPrivacyAgreement(){
uni.navigateTo({
url: '/pages/mine_privacy_agreement/mine_privacy_agreement?backPath=register'
})
},
// 售后保障协议
jumpProductAgreement(){
uni.navigateTo({
url: '/pages/mine_product_agreement/mine_product_agreement?backPath=login'
})
},
} }
} }
</script> </script>
+7 -6
View File
@@ -13,6 +13,7 @@
'width': '590rpx', 'width': '590rpx',
}" }"
v-model="form.keyword" v-model="form.keyword"
clearable
> >
<template #prefix> <template #prefix>
<up-image src="/static/common/search.png" width="20" height="20" bgColor="#f1f6ff00" @click="jumpHome"></up-image> <up-image src="/static/common/search.png" width="20" height="20" bgColor="#f1f6ff00" @click="jumpHome"></up-image>
@@ -26,7 +27,7 @@
<!-- 历史搜索 --> <!-- 历史搜索 -->
<view class="search_history" v-if="!poductList || poductList.length === 0"> <view class="search_history" v-if="!poductList || poductList.length === 0">
<view class="search_history_title"> <view class="search_history_title">
<view>历史搜索</view> <view>猜你喜欢</view>
<up-image src="/static/common/delete.png" width="20" height="20" bgColor="#f1f6ff00" @click="isShowSearch = true;"></up-image> <up-image src="/static/common/delete.png" width="20" height="20" bgColor="#f1f6ff00" @click="isShowSearch = true;"></up-image>
</view> </view>
<view class="search_history_cotent" v-if="searchList && searchList.length !==0"> <view class="search_history_cotent" v-if="searchList && searchList.length !==0">
@@ -62,7 +63,7 @@
<text>¥</text> <text>¥</text>
<text style="font-size: 36rpx;">{{item.adPrice}}</text> <text style="font-size: 36rpx;">{{item.adPrice}}</text>
</view> </view>
<view>已售{{item.price}}件</view> <view>已售9999件</view>
</view> </view>
</view> </view>
</view> </view>
@@ -78,7 +79,7 @@
<text>¥</text> <text>¥</text>
<text style="font-size: 36rpx;">{{item.adPrice}}</text> <text style="font-size: 36rpx;">{{item.adPrice}}</text>
</view> </view>
<view>已售{{item.price}}件</view> <view>已售9999件</view>
</view> </view>
</view> </view>
</view> </view>
@@ -136,9 +137,9 @@
} }
}, },
onLoad(option) { onLoad(option) {
const id = option.categoryId; const keyword = option.keyword;
if(id && id !==0){ if(keyword && keyword !==0 && keyword !== "undefined"){
this.form.categoryId = id; this.form.keyword = keyword;
this.searchClickFun(); this.searchClickFun();
} }
}, },
+120 -65
View File
@@ -1,11 +1,13 @@
<template> <template>
<view>
<view <view
:style="{'height':isDataNull ? 'calc(100vh - 134rpx)':'calc(100vh - 256rpx)'}" :style="{'height':isDataNull ? 'calc(100vh - 134rpx)':'calc(100vh - 410rpx)'}"
class="shopping_cart_warp" class="shopping_cart_warp"
> >
<view class="shopping_cart_header"> <view class="shopping_cart_header">
<view class="cart">购物车({{shoppingTotal}})</view> <view class="cart">购物车({{shoppingTotal}})</view>
<view class="enit_but" @click="isEdit = true">编辑</view> <view class="enit_but" @click="isEdit = true" v-if="!isEdit" v-show="!isDataNull">编辑</view>
<view class="enit_but" @click="isEdit = false" v-else v-show="isDataNull">取消</view>
</view> </view>
<!-- 购物车列表 --> <!-- 购物车列表 -->
<up-loading-page :loading="listLoading"></up-loading-page> <up-loading-page :loading="listLoading"></up-loading-page>
@@ -13,7 +15,7 @@
class="shopping_cart_content" class="shopping_cart_content"
> >
<view v-if="!isDataNull" class="shopping_cart_content_item" v-for="(item,index) in shoppingList" :key="item.id" > <view v-if="!isDataNull" class="shopping_cart_content_item" v-for="(item,index) in shoppingList" :key="item.id" >
<!-- 头部 --> <!-- 店铺头部 -->
<up-checkbox <up-checkbox
:customStyle="{marginBottom: '8px'}" :customStyle="{marginBottom: '8px'}"
name="isCheck" name="isCheck"
@@ -35,6 +37,7 @@
<view > <view >
<view class="content_item_info" v-for="(pItem,pIndex) in item.product" :key="pItem.id"> <view class="content_item_info" v-for="(pItem,pIndex) in item.product" :key="pItem.id">
<!-- 单个商品 -->
<up-checkbox <up-checkbox
:customStyle="{marginBottom: '8px'}" :customStyle="{marginBottom: '8px'}"
name="isCheck" name="isCheck"
@@ -44,20 +47,20 @@
activeColor="#FF7C41" activeColor="#FF7C41"
size="19" size="19"
iconSize="18" iconSize="18"
:disabled="!pItem.isAvail" :disabled="!isEdit && [1,2].includes(pItem.goodsStatus)"
@change="(event)=>productChange(event,index,pIndex)" @change="(event)=>productChange(event,index,pIndex)"
> >
</up-checkbox> </up-checkbox>
<view class="info_item" @click="jumpInfo(pItem)"> <view class="info_item" >
<up-image :src="pItem.mainGraph" width="100" height="100" bgColor="#f1f6ff00"></up-image> <up-image :src="pItem.mainGraph" width="100" height="100" bgColor="#f1f6ff00" @click="jumpInfo(pItem)"></up-image>
<view class="content_info"> <view class="content_info">
<view class="shopping_content_info_title">{{pItem.name}}</view> <view class="shopping_content_info_title" @click="jumpInfo(pItem)">{{pItem.name}}</view>
<view class="content_info_description"> <view class="content_info_description">
{{pItem.goodsSpece}} {{pItem.goodsSpece}}
</view> </view>
<view class="shopping_info_amount"> <view class="shopping_info_amount">
<view> <view>
<view style="color: #FF7C41FF;"> <view style="color: #FF7C41;">
<text style="font-size: 22rpx;">¥</text> <text style="font-size: 22rpx;">¥</text>
<text style="font-size: 32rpx;">{{pItem.unitPrice}}</text> <text style="font-size: 32rpx;">{{pItem.unitPrice}}</text>
</view> </view>
@@ -69,9 +72,9 @@
<view class="quantity_value">{{pItem.buyNum}}</view> <view class="quantity_value">{{pItem.buyNum}}</view>
<view class="quantity_but" @click="quantityFun('add',index,pIndex,pItem.id)">+</view> <view class="quantity_but" @click="quantityFun('add',index,pIndex,pItem.id)">+</view>
</view> </view>
<view v-if="!pItem.isAvail" class="insufficient_stock">库存不足</view> <view v-if="[1].includes(pItem.goodsStatus)" class="insufficient_stock">库存不足</view>
<view v-if="[2].includes(pItem.goodsStatus)" class="insufficient_stock">商品已下架</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@@ -87,6 +90,7 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view v-if="!isDataNull"> <view v-if="!isDataNull">
<view class="shopping_cart_but"> <view class="shopping_cart_but">
<!-- 全选 -->
<view class="shopping_cart_but_total"> <view class="shopping_cart_but_total">
<up-checkbox <up-checkbox
name="isAll" name="isAll"
@@ -102,12 +106,12 @@
<text style="font-size: 26rpx;color: #444444;">全选</text> <text style="font-size: 26rpx;color: #444444;">全选</text>
</template> </template>
</up-checkbox> </up-checkbox>
<text style="margin-left: 20rpx;font-size: 24rpx;color: #444444;">合计:</text> <text style="margin-left: 20rpx;font-size: 24rpx;color: #444444;" v-if="!isEdit">合计:</text>
<text style="font-size: 24rpx;">¥</text> <text style="font-size: 24rpx;" v-if="!isEdit">¥</text>
<text style="font-size: 32rpx;">{{total}}</text> <text style="font-size: 32rpx;" v-if="!isEdit">{{total}}</text>
</view> </view>
<view v-if="isEdit" class="delete_but_css" @click="deleteShopping"> <view v-if="isEdit" class="delete_but_css" @click="deleteShopping">
删除 删除({{count}})
</view> </view>
<view v-else class="add_but_css" @click="settleShopping"> <view v-else class="add_but_css" @click="settleShopping">
结算({{count}}) 结算({{count}})
@@ -117,15 +121,18 @@
<up-toast ref="uToastRef"></up-toast> <up-toast ref="uToastRef"></up-toast>
</view> </view>
<CustomTabBar :tabIndex="2"/>
</view>
</template> </template>
<script> <script>
import choiceness from '@/components/choiceness/choiceness.vue'; import choiceness from '@/components/choiceness/choiceness.vue';
import { getCartList,updateGoodsNum,removeGoods } from '@/api/cart.js'; import { getCartList,updateGoodsNum,removeGoods } from '@/api/cart.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
export default { export default {
components:{choiceness}, components:{choiceness,CustomTabBar},
data() { data() {
return { return {
shoppingTotal:0,// 总条数 shoppingTotal:0,// 总条数
@@ -139,8 +146,16 @@
listLoading:false, listLoading:false,
} }
}, },
onLoad() { onShow() {
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
this.getCartList(); this.getCartList();
},
onLoad() {
}, },
methods: { methods: {
/** /**
@@ -148,19 +163,28 @@
*/ */
async getCartList(){ async getCartList(){
this.listLoading = true; this.listLoading = true;
let result = [];
const resp = await getCartList(); const resp = await getCartList();
if(resp && resp.bizcode === 100){ if(resp && resp.bizcode === 100){
const data = resp.data || []
if(data && data.length!==0){
// 处理了后的数据 // 处理了后的数据
const data = this.transformedArray(resp.data); result = this.transformedArray(data);
this.shoppingTotal = resp.data.length;
this.shoppingList = data;
} }
this.shoppingTotal = data.length;
}
this.shoppingList = result;
this.listLoading = false; this.listLoading = false;
this.total=0;// 总合计的金额
this.count=0;// 总条数
this.isDataNull = result.length === 0 ? true:false;
}, },
// 处理购物车的数据 // 处理购物车的数据
transformedArray(originalArray){ transformedArray(originalArray){
const newOriginalArray = []; const newOriginalArray = [];
if(!originalArray || originalArray.length === 0){
return newOriginalArray;
}
originalArray.map(curr=>{ originalArray.map(curr=>{
const existingShop = newOriginalArray.find(shop => shop.shopId === curr.shopId && shop.shopName === curr.shopName); const existingShop = newOriginalArray.find(shop => shop.shopId === curr.shopId && shop.shopName === curr.shopName);
if (existingShop) { if (existingShop) {
@@ -175,7 +199,7 @@
goodsSpece: curr.goodsSpece,// 规格 goodsSpece: curr.goodsSpece,// 规格
specsId: curr.specsId,// 规格Id specsId: curr.specsId,// 规格Id
isCheck:false,// 用作于全选 isCheck:false,// 用作于全选
isAvail:curr.isAvail,// 是否有库存 goodsStatus:curr.goodsStatus,//商品状态:0-可下单,1-库存不够,2-商品已下架
}); });
} else { } else {
// 如果商店不存在,则创建一个新商店对象,并初始化 productObj 数组 // 如果商店不存在,则创建一个新商店对象,并初始化 productObj 数组
@@ -195,7 +219,7 @@
goodsSpece: curr.goodsSpece,// 规格 goodsSpece: curr.goodsSpece,// 规格
specsId: curr.specsId,// 规格Id specsId: curr.specsId,// 规格Id
isCheck:false,// 用作于全选 isCheck:false,// 用作于全选
isAvail:curr.isAvail,// 是否有库存,用作于全选 goodsStatus:curr.goodsStatus,//商品状态:0-可下单,1-库存不够,2-商品已下架
}] }]
}); });
} }
@@ -209,7 +233,14 @@
* @param {Object} cItem 需要修改的数据节点 * @param {Object} cItem 需要修改的数据节点
*/ */
async quantityFun(type,index,pIndex,id){ async quantityFun(type,index,pIndex,id){
// 选中的当前商品
const currentData = this.shoppingList[index].product[pIndex];
let currentQuantity = this.shoppingList[index].product[pIndex].buyNum;// 当前数量 let currentQuantity = this.shoppingList[index].product[pIndex].buyNum;// 当前数量
let total = Number(this.total);
let count = Number(this.count);
const data = this.shoppingList[index].product[pIndex];
if(type === "minus"){ if(type === "minus"){
if(currentQuantity === 1){ if(currentQuantity === 1){
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
@@ -219,19 +250,26 @@
return; return;
}else{ }else{
currentQuantity = currentQuantity - 1; currentQuantity = currentQuantity - 1;
total = total - data.unitPrice;
count = count - 1;
} }
}else if(type === "add"){ }else if(type === "add"){
// 需要判断一下库存 // 需要判断一下库存
currentQuantity = currentQuantity + 1; currentQuantity = currentQuantity + 1;
total = total + data.unitPrice;
count = count + 1;
} }
const params={ const params={
id, id,
goodsNum:currentQuantity, goodsNum:currentQuantity,
} }
const result = await updateGoodsNum(params); const result = await updateGoodsNum(params);
console.log("result",result);
if(result && result.bizcode === 100){ if(result && result.bizcode === 100){
this.shoppingList[index].product[pIndex].buyNum = currentQuantity; this.shoppingList[index].product[pIndex].buyNum = currentQuantity;
if(currentData.isCheck){
this.total = total.toFixed(2);
this.count = count;
}
} }
}, },
/** /**
@@ -250,7 +288,6 @@
url:"/pages/order_submit/order_submit?ids="+deleteId.join(","), url:"/pages/order_submit/order_submit?ids="+deleteId.join(","),
}) })
this.isAll = false; this.isAll = false;
this.selectCheck(false);
}, },
/** /**
* 删除选中的 * 删除选中的
@@ -259,7 +296,7 @@
const then = this; const then = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '您确定要删除选中的所有商品吗?', content: '您确定要删除选中的('+this.getCheckList().length+'件)商品吗?',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
then.deleteShoppingFun(); then.deleteShoppingFun();
@@ -283,8 +320,6 @@
const result = await removeGoods(params); const result = await removeGoods(params);
if(result && result.bizcode === 100){ if(result && result.bizcode === 100){
this.isEdit = false; this.isEdit = false;
this.isAll = false;
this.selectCheck(false);
this.$refs.uToastRef.show({ this.$refs.uToastRef.show({
type: 'success', type: 'success',
message: "删除成功", message: "删除成功",
@@ -313,17 +348,11 @@
}) })
return deleteId; return deleteId;
}, },
// 全部选中 or 全部取消选中
isAllChange(val){
this.selectCheck(val);
},
/** // 全部选中 or 全部取消选中
* 编辑是否选中 isAllChange(isAll){
*/
selectCheck(isAll){
const currentShoppingList = this.shoppingList; const currentShoppingList = this.shoppingList;
currentShoppingList.map(item=>{ currentShoppingList.map((item,index)=>{
if(isAll){ if(isAll){
item.isCheck = true; item.isCheck = true;
}else{ }else{
@@ -338,6 +367,12 @@
} }
}) })
this.shoppingList = currentShoppingList; this.shoppingList = currentShoppingList;
if(isAll){
this.checkIsAll();
}else{
this.total = 0;
this.count = 0;
}
}, },
/** /**
@@ -345,7 +380,6 @@
* @param {Object} item * @param {Object} item
*/ */
jumpInfo(item){ jumpInfo(item){
console.log("item",item);
uni.navigateTo({ uni.navigateTo({
url:'/pages/productInfo/productInfo?id='+item.goodsId, url:'/pages/productInfo/productInfo?id='+item.goodsId,
}) })
@@ -353,42 +387,63 @@
// 单个产品的单选按钮选中与取消选中 // 单个产品的单选按钮选中与取消选中
productChange(val,index,pIndex){ productChange(val,index,pIndex){
let total = this.total; setTimeout(()=>{
let count = this.count; // 检查全选按钮
const data = this.shoppingList[index].product[pIndex]; this.checkIsAll();
if(val){ },300);
total = total + data.buyNum * data.unitPrice;
count = count + data.buyNum;
}else{
total = total - data.buyNum * data.unitPrice;
count = count - data.buyNum;
}
this.total = total;
this.count = count;
}, },
// 单个店铺的单选按钮选中与取消选中 // 单个店铺的单选按钮选中与取消选中
shoppingChange(val,index){ shoppingChange(isAll,index){
let total = this.total;
let count = this.count;
const data = this.shoppingList[index]; const data = this.shoppingList[index];
data.product.map(item=>{ if(isAll){
if(val){ data.product.forEach(o => o.isCheck=true);
item.isCheck = true;
total = total + item.buyNum * item.unitPrice;
count = count + item.buyNum;
}else{ }else{
item.isCheck = false; data.product.forEach(o => o.isCheck=false);
total = total - item.buyNum * item.unitPrice; }
count = count - item.buyNum; this.shoppingList[index] = data;
setTimeout(()=>{
// 检查全选按钮
this.checkIsAll();
},300);
},
/**
* 检查是否全选
*/
checkIsAll(){
let total = 0;
let count = 0;
const shoppingList = this.shoppingList;
if(shoppingList && shoppingList.length !==0){
let sumFlag = false;
shoppingList.map(item=>{
let flag = true;
item.product.map(oItem=>{
if(oItem.isCheck){
total = total + oItem.buyNum * oItem.unitPrice;
count = count + oItem.buyNum;
}else{
flag = false;
} }
}) })
this.shoppingList[index] = data; if(flag){
this.total = total; item.isCheck = true;
sumFlag = true;
}else{
item.isCheck = false;
}
})
this.shoppingList = shoppingList;
this.isAll = sumFlag;
// 删除不需要显示价格
if(!this.isEdit){
this.total = total.toFixed(2);
}
this.count = count; this.count = count;
}
}, },
} }
} }
</script> </script>
@@ -415,7 +470,7 @@
} }
.shopping_cart_content{ .shopping_cart_content{
margin-top: 30rpx; margin-top: 30rpx;
height: calc(100vh - 304rpx); height: calc(100vh - 456rpx);
overflow-y: auto; overflow-y: auto;
.shopping_cart_content_item{ .shopping_cart_content_item{
background-color: #FFFFFF; background-color: #FFFFFF;
@@ -468,7 +523,7 @@
.shopping_cart_but{ .shopping_cart_but{
position: fixed; position: fixed;
bottom: 0; bottom: 140rpx;
left: 0; left: 0;
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
background: #FFFFFF; background: #FFFFFF;
+42 -21
View File
@@ -7,10 +7,10 @@
<view>分类</view> <view>分类</view>
<view v-if="selCategory === 1" class="category_item_sel_but"></view> <view v-if="selCategory === 1" class="category_item_sel_but"></view>
</view> </view>
<view :class="selCategory === 2 ? 'category_item category_item_sel':'category_item'" @click="checkCategory(2)"> <!-- <view :class="selCategory === 2 ? 'category_item category_item_sel':'category_item'" @click="checkCategory(2)">
<view>品牌</view> <view>品牌</view>
<view v-if="selCategory === 2" class="category_item_sel_but"></view> <view v-if="selCategory === 2" class="category_item_sel_but"></view>
</view> </view> -->
</view> </view>
<!-- 搜索 --> <!-- 搜索 -->
<view style="width: 200rpx;" @click="jumpSearch"> <view style="width: 200rpx;" @click="jumpSearch">
@@ -32,7 +32,6 @@
</view> </view>
</scroll-view> </scroll-view>
<!-- 商品类别数据 --> <!-- 商品类别数据 -->
<block>
<scroll-view scroll-y class="right-box"> <scroll-view scroll-y class="right-box">
<!-- banner图 --> <!-- banner图 -->
<view style="padding: 0rpx 20rpx;"> <view style="padding: 0rpx 20rpx;">
@@ -53,7 +52,7 @@
class="thumb-box" class="thumb-box"
v-for="(item1, index1) in item.foods" v-for="(item1, index1) in item.foods"
:key="index1" :key="index1"
@click="jumpProduct(item1)" @click="jumpSearch(item1)"
> >
<image class="item-menu-image" :src="item1.icon?item1.icon:'/static/common/def_img.jpg'" mode=""></image> <image class="item-menu-image" :src="item1.icon?item1.icon:'/static/common/def_img.jpg'" mode=""></image>
<view class="item-menu-name">{{item1.name}}</view> <view class="item-menu-name">{{item1.name}}</view>
@@ -66,20 +65,20 @@
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</block>
</view> </view>
<CustomTabBar :tabIndex="1"/>
</view> </view>
</template> </template>
<script> <script>
import classifyData from '@/common/classify.data.js';
import { getCascadeCategory } from '@/api/common.js'; import { getCascadeCategory } from '@/api/common.js';
import CustomTabBar from '@/components/custom-tab-bar.vue';
export default { export default {
components:{CustomTabBar},
data() { data() {
return { return {
selCategory:1, selCategory:1,
tabbar: classifyData,
scrollTop: 0, //tab标题的滚动条位置 scrollTop: 0, //tab标题的滚动条位置
current: null, // 预设当前项的值 current: null, // 预设当前项的值
menuHeight: 0, // 左边菜单的高度 menuHeight: 0, // 左边菜单的高度
@@ -94,23 +93,50 @@
tabbarContentLoading:false, tabbarContentLoading:false,
} }
}, },
mounted() { onShow() {
/*#ifdef APP-PLUS*/
uni.hideTabBar({
animation: false
})
/*#endif*/
},
onShow() {
const then = this; const then = this;
this.getSort(0).then(resp=>{ this.getSort(0).then(resp=>{
if(resp && resp.length !==0){ if(resp && resp.length !==0){
const fData = resp[0];
this.tabbarList = resp; this.tabbarList = resp;
const sortId = uni.getStorageSync('sortId');
// 如果有默认的参数就默认选中参数
if(sortId && sortId !==0){
let fData = {};
let currentIndex = 0;
resp.map((item,index)=>{
if(item.id === sortId){
fData = item;
currentIndex = index;
return;
}
})
this.swichMenu(fData,currentIndex);
}else{
const fData = resp[0];
// 否则就选中第一个
this.swichMenu(fData,0); this.swichMenu(fData,0);
} }
}
}); });
}, },
methods: { methods: {
checkCategory(val){ checkCategory(val){
this.selCategory = val; this.selCategory = val;
}, },
jumpSearch(){ jumpSearch(item){
let path = "/pages/search/search";
if(item && Object.keys(item).length !==0){
path = path+"?keyword="+item.name;
}
uni.navigateTo({ uni.navigateTo({
url:'/pages/search/search', url:path,
}) })
}, },
// 查询分类 // 查询分类
@@ -164,20 +190,14 @@
}).exec(); }).exec();
}) })
}, },
// 跳转到搜索页面 },
jumpProduct(item){
uni.navigateTo({
url:'/pages/search/search?categoryId='+item.id,
})
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.sort_warp{ .sort_warp{
padding: 130rpx 0rpx 0rpx; padding: 130rpx 0rpx 0rpx;
height: calc(100vh - 130rpx); height: calc(100vh - 270rpx);// 130 上边的导航栏,140下边的导航栏
} }
.sort_header{ .sort_header{
display: flex; display: flex;
@@ -215,7 +235,7 @@
display: flex; display: flex;
overflow: hidden; overflow: hidden;
margin-top: 20rpx; margin-top: 20rpx;
height: calc(100vh - 216rpx); height: calc(100vh - 356rpx);
} }
.u-search-inner { .u-search-inner {
@@ -235,11 +255,12 @@
.u-tab-view { .u-tab-view {
width: 200rpx; width: 200rpx;
height: 100%; height: 100%;
background: #f6f6f6;
} }
.u-tab-item { .u-tab-item {
height: 110rpx; height: 110rpx;
background: #f6f6f6; // background: #f6f6f6;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 387 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 822 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB

After

Width:  |  Height:  |  Size: 247 KiB

+5
View File
@@ -65,7 +65,12 @@ $uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px; $uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px; $uni-spacing-col-lg: 12px;
$app-bj:#F5F5F5; // 项目所有的背景颜色 $app-bj:#F5F5F5; // 项目所有的背景颜色
$app-zt-color:#FF7C41; // 主题色
$app-product-join-bt-bj:#323232;// 产品的按钮颜色
$app-bt-bj:#FF7C41; // 按钮背景颜色 $app-bt-bj:#FF7C41; // 按钮背景颜色
$app-bt-d-bj:#EBFFEC;// 背景淡颜色
$app-bt-orange-bj:#FF7C41; // 按钮背景颜色
$app-bt-delete-bj:#FF4141; // 按钮删除背景颜色 $app-bt-delete-bj:#FF4141; // 按钮删除背景颜色
$app-policy-color:#43B2FFFF; // 隐私政策颜色 $app-policy-color:#43B2FFFF; // 隐私政策颜色
-4
View File
@@ -1,4 +0,0 @@
## 1.0.1(2022-08-26)
1.0.1 优化文档
## 1.0.0(2022-08-25)
1.0.0 插件上线
@@ -1,116 +0,0 @@
<template>
<view class="turntable_wp sol-class">
<up-image
width="150"
height="150"
src="/uni_modules/q-turntable/static/s-dial_bg.png"
:style="'-webkit-transform:rotate(' + deg + 'deg) translateZ(0);transform:rotate(' + deg + 'deg) translateZ(0)'"
></up-image>
<view class="turntable_pointer" @tap="start">
<up-image width="50" height="50"src="/uni_modules/q-turntable/static/s-dial_pointer.png"></up-image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
deg: 0,
singleAngle: '',
// 每片扇形的角度
isStart: false
};
},
components: {},
props: {
// 划分区域
areaNumber: {
type: Number,
default: 6
},
// 速度
speed: {
type: Number,
default: 16
}
},
beforeMount() {
this.init();
},
methods: {
init() {
let { areaNumber } = this;
const singleAngle = 360 / areaNumber;
this.singleAngle = singleAngle;
},
// 点击开始抽奖
start() {
this.$emit('start');
},
begin(awardNumer) {
var deg = this.deg;
var singleAngle = this.singleAngle;
var speed = this.speed;
var isStart = this.isStart;
if (isStart) return;
this.isStart = true;
let endAddAngle = 0;
endAddAngle = 360 - ((awardNumer - 1) * singleAngle + singleAngle / 2); // 中奖角度
const rangeAngle = (Math.floor(Math.random() * 4) + 4) * 360; // 随机旋转几圈再停止
console.log(endAddAngle);
let cAngle;
deg = 0;
this.timer = setInterval(() => {
if (deg < rangeAngle) {
deg += speed;
} else {
cAngle = (endAddAngle + rangeAngle - deg) / speed;
cAngle = cAngle > speed ? speed : cAngle < 1 ? 1 : cAngle;
deg += cAngle;
if (deg >= endAddAngle + rangeAngle) {
deg = endAddAngle + rangeAngle;
this.isStart = false;
clearInterval(this.timer);
this.$emit('success');
}
}
this.deg = deg;
}, 1000 / 60);
}
}
};
</script>
<style>
.turntable_wp {
width: 610rpx;
height: 610rpx;
position: relative;
margin: 0 auto;
}
.turntable_wp image {
display: block;
width: 100%;
height: 100%;
}
.turntable_wp .turntable_pointer {
position: absolute;
width: 224rpx;
height: 224rpx;
top: 50%;
left: 50%;
margin: -125rpx 0 0 -112rpx;
}
</style>
-84
View File
@@ -1,84 +0,0 @@
{
"id": "q-turntable",
"displayName": "抽奖大转盘,支持vue2,vue3,小程序,app,h5",
"version": "1.0.1",
"description": "抽奖大转盘,支持vue2,vue3,小程序,app,h5",
"keywords": [
"抽奖",
"转盘",
"vue3",
""
],
"repository": "",
"engines": {
"HBuilderX": "^3.2.5"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}
-120
View File
@@ -1,120 +0,0 @@
# q-turntable
# 插件市场导入 转盘图片是网上找的,请开发时自行替换为自己项目的转盘图
# vue2事例代码
```
<template>
<view><q-turntable ref="turntable" @start="turntableStart" @success="turntableSuccess"></q-turntable></view>
</template>
<script>
export default {
data() {
return {
award: 1,
awardList: [
{
title: '特等奖'
},
{
title: '一等奖'
},
{
title: '二等奖'
},
{
title: '三等奖'
},
{
title: '四等奖'
},
{
title: '啥也没有'
}
] // 顺时针对应每个奖项
};
},
methods: {
// 用户点击开始抽奖
turntableStart() {
let index = Math.floor(Math.random() * 6 + 1) //前端随机数,这里应该后台返回中奖结果
this.award = index
this.$refs.turntable.begin(this.award);
},
// 抽奖完成后操作
turntableSuccess() {
const index = this.award - 1;
console.log('bind:success', this.awardList[index]);
uni.showToast({
title: `恭喜你获得${this.awardList[index].title}`,
icon: 'none'
});
},
}
}
</script>
```
# vue3示例代码
```
<template>
<view><q-turntable ref="turntable" @start="turntableStart" @success="turntableSuccess"></q-turntable></view>
</template>
<script setup>
import { reactive, toRefs, ref } from 'vue';
const data = reactive({
award: 1,
awardList: [
{
title: '特等奖'
},
{
title: '一等奖'
},
{
title: '二等奖'
},
{
title: '三等奖'
},
{
title: '四等奖'
},
{
title: '啥也没有'
}
] // 顺时针对应每个奖项
});
const turntable = ref(null);
const { award, awardList } = toRefs(data);
// 用户点击开始抽奖
const turntableStart = () => {
let index = Math.floor(Math.random() * 6 + 1);//前端随机数,这里应该后台返回中奖结果
data.award = index;
turntable.value.begin(data.award);
};
// 抽奖完成后操作
const turntableSuccess = () => {
const index = data.award - 1;
uni.showToast({
title: `恭喜你获得${data.awardList[index].title}`,
icon: 'none'
});
};
</script>
<style>
</style>
```
# 如果插件对你们有帮助的话,请给个五星鼓励一下,谢谢!如果遇到问题或者有更好的建议可以加我qq 965969604
Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
https://app.liuyingyong.cn/build/download/ba78cbc0-fb37-11ef-9633-f5760386061d https://app.liuyingyong.cn/build/download/44e561b0-1f59-11f0-b44e-03b9842c646b
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,4 +1,4 @@
andrCertfile=E:/资料/哈希优品/上架资料/hash.keystore andrCertfile=/Users/amy/project/ydProject/hash/哈希优品/上架资料/hash.keystore
andrCertAlias=__UNI__DA4D660 andrCertAlias=__uni__da4d660
andrCertPass=3dIlBZPK1d2l7t66MhDEDA== andrCertPass=3dIlBZPK1d2l7t66MhDEDA==
storePassword=3dIlBZPK1d2l7t66MhDEDA== storePassword=3dIlBZPK1d2l7t66MhDEDA==
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

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