diff --git a/main.js b/main.js index b2b3543..f028e15 100644 --- a/main.js +++ b/main.js @@ -1,15 +1,15 @@ // #ifndef VUE3 +import setFonts from './common/setFonts.js' import Vue from 'vue' import App from './App' -Vue.config.productionTip = false +Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() - // #endif // #ifdef VUE3 diff --git a/pages.json b/pages.json index 722f957..d6e7d06 100644 --- a/pages.json +++ b/pages.json @@ -4,7 +4,9 @@ "path" : "pages/home/home", "style" : { - "navigationBarTitleText" : "" + "navigationBarTitleText" : "首页", + "enablePullDownRefresh":true, //开启下拉刷新 + "navigationBarBackgroundColor": "#ede8e7" } }, { @@ -73,7 +75,7 @@ } }, { - "path" : "pages/order/product-unpay/product-unpay", + "path" : "pages/order/product-paysuccess/product-paysuccess", "style" : { "navigationBarTitleText" : "" @@ -196,6 +198,13 @@ { "navigationBarTitleText" : "" } + }, + { + "path" : "pages/store-home/main/testMain", + "style" : + { + "navigationBarTitleText" : "" + } } ], "globalStyle": { diff --git a/pages/home/home.vue b/pages/home/home.vue index 5ef96e8..8b43920 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -1,7 +1,7 @@ <template> <view class="flex-col justify-start relative page"> <view class="section"></view> - <image class="image pos" src="https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=flower.png" /> + <image class="image pos" src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FCSSXOwDH-flower.png" /> <text class="text pos_6">限定手制|非量售卖</text> <text class="font pos_2">匠</text> <text class="font pos_3">承</text> @@ -11,7 +11,7 @@ <view class="flex-row grid-item" @click="jump_xiezhen"> <image class="shrink-0 self-center image_2" - src="https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=firsticon.png" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FenkBYRuk-firsticon.png" /> <view class="ml-4 flex-col items-center flex-1 self-start group"> <text class="font_2 text_2">写真预约</text> @@ -21,7 +21,7 @@ <view class="flex-row items-center grid-item_2" @click="jump_feiyi"> <image class="shrink-0 image_3" - src="https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=secondicon.png" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FKLEsLGUY-secondicon.png" /> <view class="flex-col items-center flex-1 ml-7"> <text class="font_2">手作材包</text> @@ -31,7 +31,7 @@ <view class="flex-row grid-item_3" @click="jump_store"> <image class="shrink-0 self-center image_5" - src="https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=thirdicon1.png" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FoHoMDXDs-tirdicon2.png" /> <view class="flex-col items-center flex-1 self-start group_2 ml-7"> <text class="font_2 text_5">推荐商品</text> @@ -41,7 +41,7 @@ <view class="flex-row relative grid-item_4"> <image class="shrink-0 self-center image_4" - src="https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=fourthicon.png" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FlMKuKgjS-fourthicon.png" /> <text class="self-start font_2 text_4">活动咨询</text> <text class="font_3 pos_8">朴物良社,匠心手作</text> @@ -51,9 +51,9 @@ </template> <script setup> -import {ref} from 'vue' +import {inject, ref} from 'vue' import { baseUrl, testUrl , suiUrl} from '@/api/request'; -import { onShow } from "@dcloudio/uni-app"; +import { onShow,onLoad } from "@dcloudio/uni-app"; //变量 const items = ref( [null, null, null]) const items_1 = ref( [null, null, null]) @@ -61,6 +61,9 @@ onShow(() => { uni.removeStorageSync('businessId') getMyUser() }) +onLoad(()=>{ + getFonts() +}) const getMyUser = async () =>{ const res = await uni.request({ url: baseUrl + '/user/get/login', @@ -81,7 +84,7 @@ const getMyUser = async () =>{ }) } } -const jump_xiezhen =()=>{ +const jump_xiezhen =()=>{ //跳转写真预约 uni.navigateTo({ url: '../../pages/booking/respectable/respectable' }) @@ -96,14 +99,36 @@ const jump_store =()=>{ url: '/pages/store-home/main/main' }) } +const getFonts =()=>{ + uni.loadFontFace({ + family: 'ZhongShanFonts', + source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/ZhongShanFonts.ttf")`, + success:(res) =>{ + console.log('success',res); + }, + fail:(err) => { + console.log('err',err); + } + }) + uni.loadFontFace({ + family: 'FangZhengFonts', + source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/FangZhengFonts.TTF")`, + success:(res) =>{ + console.log('success',res); + }, + fail:(err) => { + console.log('err',err); + } + }) +} </script> <style lang="scss" scoped> .ml-7 { - margin-left: 13.13rpx; + margin-left: 4.13rpx; } .page { - background-image: url('https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=background.png'); + background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png'); background-size: 100% 100%; background-repeat: no-repeat; width: 100%; @@ -112,7 +137,7 @@ const jump_store =()=>{ height: 100%; } .section { - background-image: url('https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=background.png'); + background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png'); background-size: 100% 100%; background-repeat: no-repeat; width: 750rpx; @@ -130,9 +155,9 @@ const jump_store =()=>{ top: 0; } .text { - color: #9d2624; + color: #C35C5D; font-size: 37.5rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: FangZhengFonts; line-height: 36.92rpx; } .pos_6 { @@ -143,9 +168,9 @@ const jump_store =()=>{ } .font { font-size: 168.75rpx; - font-family: Sun Yat-sen Hsingshu; + font-family: ZhongShanFonts; line-height: 202.5rpx; - color: #c35c5d; + color: #C35C5D; } .pos_2 { position: absolute; @@ -195,7 +220,7 @@ const jump_store =()=>{ } .font_2 { font-size: 28.13rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: FangZhengFonts; line-height: 26.47rpx; color: #000000; } @@ -228,7 +253,7 @@ const jump_store =()=>{ } .font_3 { font-size: 18.75rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: FangZhengFonts; line-height: 17.29rpx; color: #faddde; } @@ -254,9 +279,12 @@ const jump_store =()=>{ } .pos_8 { position: absolute; - right: 7.14rpx; + right: 18.14rpx; bottom: 24.28rpx; } @import url(../../common/css/global.css); - +// @font-face { +// font-family: "ZhongShanFonts"; +// src: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/ZhongShanFonts.ttf'); +// } </style> diff --git a/pages/mine/main/main.vue b/pages/mine/main/main.vue index 46646c9..63cb483 100644 --- a/pages/mine/main/main.vue +++ b/pages/mine/main/main.vue @@ -1,357 +1,353 @@ <template> <view class="flex-col page"> - <view class="flex-row section"> - <image class="self-center image" :src="avator" /> - <view class="flex-col self-start group"> - <text class="self-start text">默认用户</text> - <view class="flex-col justify-start items-center self-stretch text-wrapper mt-6"> - <text class="font text_2">剩余积分:0</text> - </view> - </view> - <view class="flex-col justify-start items-center self-start text-wrapper_2"> - <text class="font text_3">优惠卷:0 张</text> - </view> - </view> - <view class="flex-col relative group_2"> - <view class="flex-row equal-division"> - <view class="flex-col items-center group_3 group_1" @click="goto()"> - <image class="image_2" :src="dingdan" /> - <text class="font text_4">总订单</text> - </view> - <view class="flex-col items-center group_3 group_4"> - <image class="image_2" :src="qianbao" /> - <text class="font text_1">待付款</text> - </view> - <view class="flex-col items-center group_3 group_5"> - <image class="image_2" :src="daifahuo" /> - <text class="font">待发货</text> - </view> - <view class="flex-col items-start group_3 group_6"> - <image class="image_2" :src="daishouhuo" /> - <text class="font">待收货</text> - </view> - <view class="flex-col items-center group_3 group_7"> - <image class="image_2" :src="tuikuan" /> - <text class="font text_9">退款/售后</text> - </view> - </view> - <view class="flex-col mt-37"> - <view class="flex-row justify-between items-center section_2"> - <view class="flex-row items-center"> - <image class="shrink-0 image_3" :src="address" /> - <text class="font_2 ml-5">地址列表</text> - </view> - <image class="image_4 image_5" :src="you" /> - </view> - <view class="list-divider mt-5"></view> - <view class="flex-row justify-between items-center section_4 mt-5" @click="goToText()"> - <view class="flex-row items-center"> - <image class="shrink-0 image_3" :src="lianxiren_s" /> - <text class="font_2 text_5 ml-5">联系人列表</text> - </view> - <image class="image_6" :src="you" /> - </view> - <view class="list-divider mt-5"></view> - <view class="flex-row justify-between items-center list-item_2 mt-5" @click="goTo()"> - <view class="flex-row items-center"> - <image class="shrink-0 image_8" :src="setting_s" /> - <text class="font_2 text_6 ml-7">设置</text> - </view> - <image class="image_4 image_7" :src="you" /> - </view> - </view> - </view> + <view class="flex-col group"> + <view class="flex-row items-center group_2"> + <image + class="image" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FtiKFGDAi-avator.png" + /> + <view class="ml-20 flex-col items-start flex-1"> + <text class="text">微信用户</text> + <text class="mt-18 font text_2">剩余积分:40</text> + </view> + </view> + <view class="flex-row equal-division"> + <view class="flex-col items-center" @click="goto"> + <image + class="shrink-0 image_2" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FjqkEyOpY-totalorder.png" + /> + <text class="font text_3">总订单</text> + </view> + <view class="flex-col items-center ml-1"> + <image + class="shrink-0 image_2" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FEzgKLIBS-waitproduct.png" + /> + <text class="font text_5">待发货</text> + </view> + <view class="flex-col items-center ml-1"> + <image + class="shrink-0 image_2" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FVWTrHegX-waitpay.png" + /> + <text class="font text_4">待付款</text> + </view> + <view class="flex-col items-center ml-1"> + <image + class="shrink-0 image_2" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FWAdobYmD-waitshouhou.png" + /> + <text class="font text_6">待收货</text> + </view> + <view class="flex-col items-center ml-1"> + <image + class="shrink-0 image_2" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FGEFKFVXw-shouhou.png" + /> + <text class="font text_7">退款/售后</text> + </view> + </view> + </view> + <view class="flex-col mt-37"> + <view class="flex-col group_3"> + <view class="flex-row justify-between relative"> + <image + class="image_3" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FSJZTOttL-address.png" + /> + <image + class="self-start image_4 image_5" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" + /> + <text class="font_2 text_8 pos">地 址 列 表</text> + <view class="divider pos_2"></view> + </view> + <view class="flex-row justify-between relative" @click="goToText"> + <image + class="image_6" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FejVXliLM-contact.png" + /> + <image + class="self-start image_4 image_7" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" + /> + <text class="font_2 pos_3">联系人列表</text> + <view class="divider pos_4"></view> + </view> + </view> + <view class="flex-row justify-between group_4"> + <view class="flex-row items-center"> + <image + class="shrink-0 image_8" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FOfemexvK-booking.png" + /> + <text class="font_2 text_9">我 的 预 约</text> + </view> + <image + class="self-start image_4 image_9" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" + /> + </view> + <view class="flex-col group_5"> + <view class="divider view"></view> + <view class="flex-row justify-between items-center group_6"> + <view class="flex-row items-center"> + <image + class="shrink-0 image_10" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FqihgypDY-coupon.png" + /> + <text class="font_2">我的优惠券</text> + </view> + <image + class="image_4 image_11" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" + /> + </view> + <view class="divider view_2"></view> + <view class="flex-row justify-between group_7"> + <view class="flex-row self-center"> + <view class="flex-row shrink-0"> + <image + class="shrink-0 image_12" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FlGcdVAji-setting.png" + /> + <text class="ml-10 self-start font_3 text_10">设</text> + </view> + <text class="ml-60 self-start font_3 text_11">置</text> + </view> + <image + class="self-start image_4 image_13" + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" + /> + </view> + </view> + </view> </view> </template> <script setup> - import { - ref - } from 'vue' - const goto = () => { - uni.navigateTo({ - url: "/pages/mine/mineorders/mineorders" - }) - } - - const store = userStore() - const login = () => { - uni.getUserProfile({ - lang: 'zh_CN', - desc: '用户登录', // 声明获取用户个人信息后的用途,后续会展示在弹窗中, - success: (res) => { - console.log(res, 'resss') - resolve(res.userInfo) - }, - fail: (err) => { - reject(err) - } - }) - - // uni.login({ - // provider: 'weixin', - // success: (loginRes) => { - // if(loginRes.code !== null) { - // console.log("获取code:" + loginRes.code) - // loginUser(loginRes.code); - // } else { - // console.log("code为空"); - // } - // } - // }) - } - const loginUser = (code) => { - uni.request({ - url: apiImageUrl + 'user/login/wx_open', - method: 'GET', - data: { - code: code - }, - success: (res) => { - console.log(res, "是否有code") - uni.removeStorageSync('cookie'); // 保fCookie到Storage - uni.setStorageSync("cookie", res.header['Set-Cookie']); - if (res.data.code == 1) { - uni.showToast({ - title: '登录成功', - duration: 2000 - }) - - //每次登录时清楚缓存 - uni.setStorageSync('userInfo', res.data.data) - uni.switchTab({ - url: '/pages/index/index' - }) - } else { - uni.showToast({ - icon: 'error', - title: "登录失败,请联系管理员" - }) - return - } - - } - }) - } - const goToText = () => { - uni.navigateTo({ - url: '/pages/mine/Contact/Contact' - }) - } - const goTo = ()=>{ - uni.navigateTo({ - url: '/pages/mine/bookings/booking' - }) - } +import { onMounted, ref } from 'vue'; +import { onShow,onLoad } from "@dcloudio/uni-app"; +onMounted(()=>{ + getFonts() //启动使从服务器下载字体 +}) +const goto = () => { //跳转到订单 + uni.navigateTo({ + url: "/pages/mine/mineorders/mineorders" + }) +} +const goToText = () => { //跳转到联系人信息 + uni.navigateTo({ + url: '/pages/mine/Contact/Contact' + }) +} +const goTo = ()=>{ //跳转到预约 + uni.navigateTo({ + url: '/pages/mine/bookings/booking' + }) +} +const getFonts =()=>{ //导入字体 + uni.loadFontFace({ + family: 'FangZhengFonts', + source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/FangZhengFonts.TTF")`, + success:(res) =>{ + console.log('success',res); + }, + fail:(err) => { + console.log('err',err); + } + }) +} </script> <style lang="scss" scoped> - .mt-37 { - margin-top: 69.38rpx; - } - - .ml-5 { - margin-left: 9.38rpx; - } - - .mt-5 { - margin-top: 9.38rpx; - } - - .ml-7 { - margin-left: 13.13rpx; - } - - .page { - // padding-bottom: 564.38rpx; - background-color: #ffffff; - // height: 100%; - width: 100%; - overflow-y: auto; - overflow-x: hidden; - overflow: hidden; - } - - .section { - padding: 213.75rpx 0 105rpx; - background-image: url('https://ide.code.fun/api/image?token=6711ccc71511d900114adddf&name=608ce961205c6b6c4a5f231d50bcfd3e.png'); - background-size: 100% 100%; - background-repeat: no-repeat; - } - - .image { - border-radius: 50%; - width: 150rpx; - height: 151.88rpx; - } - - .group { - margin-left: 34.67rpx; - margin-top: 32.06rpx; - } - - .text { - color: #000000; - font-size: 37.5rpx; - font-family: Open Sans; - line-height: 34.91rpx; - } - - .text-wrapper { - padding: 23.34rpx 0 23.85rpx; - background-color: #fbdab4; - border-radius: 18.75rpx; - width: 222.34rpx; - } - - .font { - font-size: 26.25rpx; - font-family: Open Sans; - line-height: 24.34rpx; - color: #000000; - } - - .text_2 { - font-size: 28.13rpx; - line-height: 25.93rpx; - } - - .text-wrapper_2 { - margin-left: 24.49rpx; - margin-top: 78.75rpx; - padding: 23.27rpx 0 23.85rpx; - background-color: #ffdab1; - border-radius: 18.75rpx; - width: 222.34rpx; - height: 73.13rpx; - } - - .text_3 { - font-size: 28.13rpx; - line-height: 26.03rpx; - } - - .group_2 { - margin-top: -48.75rpx; - padding-left: 26.25rpx; - padding-right: 26.23rpx; - } - - .equal-division { - padding: 14.38rpx 18.92rpx 31.05rpx; - background-color: #fff1e2; - border-radius: 9.38rpx; - } - - .group_3 { - flex: 1 1 131.93rpx; - } - - .group_1 { - padding: 9.99rpx 0 9.99rpx; - } - - .image_2 { - width: 95.63rpx; - height: 95.63rpx; - } - - .text_4 { - line-height: 24.07rpx; - } - - .group_4 { - padding: 9.99rpx 0 11.79rpx; - } - - .text_1 { - line-height: 24.23rpx; - } - - .group_5 { - padding: 9.99rpx 0 11.76rpx; - } - - .group_6 { - padding: 9.99rpx 6.64rpx 11.76rpx 29.66rpx; - } - - .group_7 { - padding: 10.01rpx 0 11.94rpx; - } - - .text_9 { - font-size: 24.38rpx; - line-height: 22.52rpx; - } - - .section_2 { - padding: 22.5rpx 26.61rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - } - - .image_3 { - width: 43.13rpx; - height: 43.13rpx; - } - - .font_2 { - font-size: 30rpx; - font-family: Open Sans; - line-height: 27.69rpx; - color: #000000; - } - - .image_4 { - width: 48.75rpx; - height: 48.75rpx; - } - - .image_5 { - margin-right: 6.38rpx; - } - - .list-divider { - background-color: #0000002e; - height: 1.89rpx; - } - - .section_4 { - padding: 22.95rpx 26.61rpx 22.05rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - } - - .text_5 { - line-height: 27.86rpx; - } - - .image_6 { - margin-right: 6.38rpx; - width: 48.75rpx; - height: 50.63rpx; - } - - .list-item_2 { - padding: 22.5rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - } - - .image_8 { - filter: drop-shadow(0rpx 7.5rpx 3.75rpx #00000040); - width: 43.13rpx; - height: 43.13rpx; - } - - .text_6 { - line-height: 27.11rpx; - } - - .image_7 { - margin-right: 10.48rpx; - } - - @import url(../../../common/css/global.css); +.ml-1 { + margin-left: 1.88rpx; +} +.mt-37 { + margin-top: 69.38rpx; +} +.page { + padding: 135rpx 0 211.88rpx; + background-color: #ffffff00; + background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png'); + background-size: 100% 100%; + width: 100%; + overflow-y: hidden; + overflow-x: hidden; + height: 100vh; +} +.group { + padding: 0 7.5rpx; +} +.group_2 { + margin: 0 30rpx; + padding: 0 7.5rpx 37.5rpx; + border-bottom: solid 0.94rpx #aeaeae; +} +.image { + border-radius: 50%; + width: 150rpx; + height: 151.88rpx; +} +.text { + color: #000000; + font-size: 45rpx; + font-family: FangZhengFonts; + line-height: 40.61rpx; +} +.font { + font-size: 28.13rpx; + font-family: FangZhengFonts; + line-height: 27.02rpx; + color: #000000; +} +.text_2 { + margin-left: 7.5rpx; + font-size: 30rpx; + line-height: 27.9rpx; +} +.equal-division { + margin-right: 5.63rpx; +} +.image_2 { + width: 144rpx; + height: 144rpx; +} +.text_3 { + margin-top: -7.5rpx; +} +.text_5 { + margin-top: -7.5rpx; +} +.text_4 { + margin-top: -7.5rpx; +} +.text_6 { + margin-top: -7.5rpx; +} +.text_7 { + margin-top: -7.5rpx; +} +.group_3 { + padding: 0 35.63rpx; +} +.image_3 { + width: 120rpx; + height: 123.75rpx; +} +.image_4 { + width: 39.38rpx; + height: 41.25rpx; +} +.image_5 { + margin-right: 31.88rpx; + margin-top: 52.5rpx; +} +.font_2 { + font-size: 37.5rpx; + font-family: FangZhengFonts; + line-height: 36.47rpx; + color: #000000; +} +.text_8 { + line-height: 35.74rpx; +} +.pos { + position: absolute; + left: 121.76rpx; + top: 50%; + transform: translateY(-50%); +} +.divider { + background-color: #aeaeae; + height: 0.94rpx; +} +.pos_2 { + position: absolute; + left: 3.75rpx; + right: 37.5rpx; + top: 117.19rpx; +} +.image_6 { + width: 120rpx; + height: 125.63rpx; +} +.image_7 { + margin-right: 31.88rpx; + margin-top: 52.5rpx; +} +.pos_3 { + position: absolute; + left: 116.72rpx; + top: 50%; + transform: translateY(-50%); +} +.pos_4 { + position: absolute; + left: 3.75rpx; + right: 37.5rpx; + top: 124.69rpx; +} +.group_4 { + margin-top: 4rpx; + padding: 0 28.13rpx 11.25rpx; +} +.image_8 { + width: 133.13rpx; + height: 114.38rpx; +} +.text_9 { + padding-top: 20rpx; + margin-left: -7.5rpx; + line-height: 33.99rpx; +} +.image_9 { + margin-right: 41.25rpx; + margin-top: 45.5rpx; +} +.group_5 { + padding: 0 39.38rpx; +} +.view { + margin-right: 33.75rpx; +} +.group_6 { + padding: 22.5rpx 0 7.5rpx; +} +.image_10 { + width: 118.13rpx; + height: 101.25rpx; +} +.image_11 { + margin-right: 28.13rpx; +} +.view_2 { + margin-right: 31.88rpx; +} +.group_7 { + padding: 28.13rpx 7.5rpx 0; +} +.image_12 { + width: 91.88rpx; + height: 91.88rpx; +} +.font_3 { + font-size: 37.5rpx; + font-family: FangZhengFonts; + line-height: 30.47rpx; + color: #000000; +} +.text_10 { + margin-top: 26.25rpx; +} +.text_11 { + margin-top: 22.5rpx; +} +.image_13 { + margin-right: 20.63rpx; + margin-top: 16.88rpx; +} +@import url(../../../common/css/global.css); </style> \ No newline at end of file diff --git a/pages/order/product-unpay/product-unpay.vue b/pages/order/product-unpay/product-unpay.vue deleted file mode 100644 index 9f0ddba..0000000 --- a/pages/order/product-unpay/product-unpay.vue +++ /dev/null @@ -1,452 +0,0 @@ -<template> - <view class="flex-col page"> - <view class="flex-col"> - <!-- <view class="flex-col justify-start items-start image-wrapper"> - <image - class="image" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=a5af1f04bfd2af602d9d0f811b50717c.png" - /> - </view> --> - <view class="flex-col group"> - <view class="flex-row items-center section"> - <image - class="image_2" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=ed4d5bcc4901016159530a1e5493a83f.png" - /> - <view class="ml-6 flex-col items-start flex-1"> - <text class="font text">等待买家付款</text> - <text class="font_2 text_2 mt-5">请于13分51秒内付款,超时订单将自动关闭</text> - </view> - </view> - <view class="flex-row items-center section_2 mt-7"> - <image - class="shrink-0 image_3" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=5da41d16a3c58ce9514d9a7f9ee5a577.png" - /> - <view class="ml-8 flex-col items-start flex-1"> - <text class="font text_3">张三 15888610253</text> - <text class="mt-12 font_2 text_4">黑龙江省哈尔滨市呼兰区学院路街道288号哈尔滨华德学院</text> - </view> - </view> - <view class="flex-col section_3 mt-7"> - <view class="flex-row justify-between items-end self-stretch group_2"> - <view class="flex-row"> - <image - class="image_4" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=1ab7a54755e0a23722c1b9dd0ae981c4.png" - /> - <view class="flex-col group_3 ml-17"> - <view class="flex-col"> - <view class="flex-row self-stretch"> - <text class="font">非遗绒花</text> - <text class="ml-4 font">【材料包】</text> - </view> - <text class="self-start font_2 text_5 mt-11">已选种类:紫色</text> - </view> - <view class="mt-38 flex-row items-center"> - <view class="flex-row items-center group_4"> - <text class="text_6">138.</text> - <image - class="image_5 image_6" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=4223cdafed72fca52c442dae885cee9c.png" - /> - </view> - <text class="font_3 text_7">00</text> - </view> - </view> - </view> - <text class="font_3 text_8">×1</text> - </view> - <view class="flex-row justify-between items-center self-stretch group_5"> - <text class="font_4 text_9">商品金额</text> - <view class="flex-row items-center group_6"> - <image - class="shrink-0 image_5" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=4223cdafed72fca52c442dae885cee9c.png" - /> - <text class="font_3">138.00</text> - </view> - </view> - <view class="flex-row justify-between items-center self-stretch group_7"> - <text class="font_4 text_10">优惠券</text> - <view class="flex-row items-center group_8"> - <image - class="shrink-0 image_7" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=40498ff9c7a50c056417f381edf937db.png" - /> - <text class="font_3">50.00</text> - </view> - </view> - <view class="flex-row justify-end items-center self-stretch group_9"> - <view class="flex-row items-center group_10"> - <image - class="image_5 image_8" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=f1d048b70eca2a37b0db8f3bd9989205.png" - /> - <text class="font text_11">合计:</text> - </view> - <text class="font_3 text_12">88.00</text> - </view> - <view class="self-stretch divider view"></view> - <text class="self-start font_4 text_13">买家留言</text> - <view class="flex-col justify-start self-stretch text-wrapper"> - <text class="font_2 text_14"> - 希望所使用的材料是可持续来源的,并且制作工艺要精细,以确保每一朵花瓣都能生动地展现出绒花的质感和美感。 - </text> - </view> - <view class="self-stretch divider view_2"></view> - <view class="flex-row justify-between self-stretch group_11"> - <text class="font_2 text_15">订单编号:</text> - <view class="flex-row items-center group_12"> - <text class="font_5 text_16">E20241005095840091406189</text> - <view class="ml-2 flex-col justify-start items-center shrink-0 text-wrapper_2"> - <text class="text_17">复制</text> - </view> - </view> - </view> - <view class="flex-row justify-between items-center self-stretch group_13"> - <text class="font_2 text_18">创建时间:</text> - <text class="font_5 text_19">2024-10-05 09:58:41</text> - </view> - </view> - </view> - </view> - <view class="flex-row justify-between items-center section_4 mt-284"> - <view class="flex-row items-center"> - <image - class="shrink-0 image_9" - src="https://ide.code.fun/api/image?token=6710b0541511d900114acbc6&name=2f24539fd031a6d564aa246956b79046.png" - /> - <text class="text_21">88.</text> - <text class="font_6 text_20">合计:</text> - <text class="text_23">00</text> - </view> - <view class="flex-col justify-start items-center text-wrapper_3"><text class="font_6 text_22">去支付</text></view> - </view> - </view> -</template> - -<script setup> - - -</script> - -<style lang="scss" scoped> -.mt-5 { - margin-top: 9.38rpx; -} -.mt-7 { - margin-top: 13.13rpx; -} -.ml-17 { - margin-left: 31.88rpx; -} -.mt-11 { - margin-top: 20.63rpx; -} -.mt-284 { - margin-top: 532.5rpx; -} -.page { - background-color: #fffaf0; - width: 100%; - overflow-y: auto; - overflow-x: hidden; - // height: 100%;固定了 - height: 100vh; - overflow: hidden; -} -.image-wrapper { - padding: 15rpx 0; - background-color: #a0522d; -} -.image { - margin-left: 16.88rpx; - width: 37.5rpx; - height: 37.5rpx; -} -.group { - padding: 15rpx 15rpx 0; -} -.section { - padding: 15rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - border-left: solid 1.88rpx #818181; - border-right: solid 1.88rpx #818181; - border-top: solid 1.88rpx #818181; - border-bottom: solid 1.88rpx #818181; -} -.image_2 { - width: 75rpx; - height: 75rpx; -} -.section_2 { - padding: 33.75rpx 15rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - border-left: solid 1.88rpx #818181; - border-right: solid 1.88rpx #818181; - border-top: solid 1.88rpx #818181; - border-bottom: solid 1.88rpx #818181; -} -.image_3 { - width: 43.13rpx; - height: 43.13rpx; -} -.font_2 { - font-size: 22.5rpx; - font-family: Open Sans; - line-height: 19.39rpx; - color: #818181; -} -.text_2 { - color: #6b6e72; - line-height: 21.34rpx; -} -.text_4 { - line-height: 20.91rpx; -} -.section_3 { - padding: 0 15rpx 26.25rpx 22.5rpx; - background-color: #fffef8; - border-radius: 18.75rpx; - border-left: solid 1.88rpx #818181; - border-right: solid 1.88rpx #818181; - border-top: solid 1.88rpx #818181; - border-bottom: solid 1.88rpx #818181; -} -.group_2 { - padding: 18.75rpx 0; - border-bottom: solid 1.88rpx #dfdfdf; -} -.image_4 { - margin-bottom: 5.63rpx; - border-radius: 9.38rpx; - width: 146.25rpx; - height: 165rpx; -} -.group_3 { - margin-top: 3.75rpx; -} -.font { - font-size: 26.25rpx; - font-family: Open Sans; - line-height: 24.43rpx; - color: #323232; -} -.text_3 { - line-height: 23.77rpx; -} -.text { - color: #323233; - font-size: 28.13rpx; - line-height: 26.08rpx; -} -.text_5 { - line-height: 20.79rpx; -} -.group_4 { - width: 90.66rpx; -} -.text_6 { - margin-left: 26.25rpx; - color: #323232; - font-size: 33.75rpx; - font-family: Open Sans; - font-weight: 600; - line-height: 24.88rpx; -} -.image_5 { - width: 30rpx; - height: 30rpx; -} -.image_6 { - margin-left: -90rpx; -} -.font_3 { - font-size: 26.25rpx; - font-family: Open Sans; - line-height: 19.39rpx; - color: #323232; -} -.text_7 { - font-weight: 600; - line-height: 19.29rpx; -} -.text_8 { - margin-right: 11.25rpx; - margin-bottom: 7.5rpx; - line-height: 18.73rpx; -} -.group_5 { - margin-top: 26.25rpx; -} -.font_4 { - font-size: 26.25rpx; - font-family: Open Sans; - line-height: 24.43rpx; - color: #818181; -} -.text_9 { - line-height: 24.28rpx; -} -.group_6 { - margin-right: 3.75rpx; -} -.group_7 { - margin-top: 13.13rpx; -} -.text_10 { - line-height: 24.26rpx; -} -.group_8 { - margin-right: 3.75rpx; -} -.image_7 { - width: 41.25rpx; - height: 30rpx; -} -.group_9 { - margin-top: 16.88rpx; - padding: 0 3.75rpx; -} -.group_10 { - width: 102.26rpx; -} -.image_8 { - margin-left: 71.25rpx; -} -.text_11 { - margin-left: -101.25rpx; - line-height: 24.09rpx; -} -.text_12 { - color: #fb8b05; -} -.divider { - background-color: #dfdfdf; - height: 1.88rpx; -} -.view { - margin-right: 7.5rpx; - margin-top: 16.88rpx; -} -.text_13 { - margin-top: 30rpx; - line-height: 24.21rpx; -} -.text-wrapper { - margin-right: 7.5rpx; - margin-top: 15rpx; - padding: 15rpx 0 11.25rpx; - background-color: #fffef8; - border-radius: 9.38rpx; - border-left: solid 1.88rpx #f0f0b5; - border-right: solid 1.88rpx #f0f0b5; - border-top: solid 1.88rpx #f0f0b5; - border-bottom: solid 1.88rpx #f0f0b5; -} -.text_14 { - margin-left: 15rpx; - margin-right: 18.75rpx; - line-height: 26.25rpx; -} -.view_2 { - margin-right: 7.5rpx; - margin-top: 18.75rpx; -} -.group_11 { - margin-top: 22.5rpx; -} -.text_15 { - line-height: 20.85rpx; -} -.group_12 { - margin-right: 7.5rpx; -} -.font_5 { - font-size: 22.5rpx; - font-family: Open Sans; - color: #323232; -} -.text_16 { - line-height: 16.54rpx; -} -.text-wrapper_2 { - background-color: #fffef8; - width: 50.63rpx; - height: 22.5rpx; - border-left: solid 0.94rpx #d1d1d1; - border-right: solid 0.94rpx #d1d1d1; - border-top: solid 0.94rpx #d1d1d1; - border-bottom: solid 0.94rpx #d1d1d1; -} -.text_17 { - color: #323232; - font-size: 18.75rpx; - font-family: Open Sans; - line-height: 17.38rpx; -} -.group_13 { - margin-top: 11.25rpx; -} -.text_18 { - line-height: 20.7rpx; -} -.text_19 { - margin-right: 161.25rpx; - line-height: 16.63rpx; -} -.section_4 { - position: fixed; - left: 0; - right: 0; - margin: auto; - bottom: 0; - padding: 15rpx 26.25rpx; - background-color: #ffffff; -} -.image_9 { - margin-left: 86.25rpx; - width: 33.75rpx; - height: 33.75rpx; -} -.text_21 { - color: #fbb612; - font-size: 37.5rpx; - font-family: Open Sans; - font-weight: 700; - line-height: 27.62rpx; -} -.font_6 { - font-size: 30rpx; - font-family: Open Sans; - line-height: 27.62rpx; -} -.text_20 { - margin-left: -172.5rpx; - color: #000000; - line-height: 27.54rpx; -} -.text_23 { - margin-left: 78.75rpx; - color: #fbb612; - font-size: 30rpx; - font-family: Open Sans; - font-weight: 700; - line-height: 22.05rpx; -} -.text-wrapper_3 { - padding: 22.5rpx 0; - background-color: #fbb612; - border-radius: 75rpx; - width: 204.38rpx; - height: 71.25rpx; -} -.text_22 { - color: #ffffff; - line-height: 27.86rpx; -} -@import url(../../../common/css/global.css); -</style> diff --git a/pages/order/product-waitpay/product-waitpay.vue b/pages/order/product-waitpay/product-waitpay.vue index e923396..4a7879f 100644 --- a/pages/order/product-waitpay/product-waitpay.vue +++ b/pages/order/product-waitpay/product-waitpay.vue @@ -166,6 +166,7 @@ import {onMounted, ref, toRaw} from 'vue' import emitter from '../../../utils/emitter' import { onLoad , onShow } from "@dcloudio/uni-app"; import { baseUrl } from '../../../api/request'; +import addressComponentVue from '../component/addressComponent.vue'; //导入组件 //一些暂时变量 const num = ref(1) const price = ref(138) @@ -246,30 +247,19 @@ const createOrder = async () => { cookie: wx.getStorageSync('cookie') }, data: { - userId: userInfo.id, orderType: productArr.value[0].goodVO.isGoodType ? 'product' : 'service' , userName: userInfo.userName, - orderNumber: "null", addressId: addressRealInfo.value.id, //地址信息id // contactsId: null, //联系人信息id // couponId: null, //优惠卷id totalAmount: sumprice.value, //实付价格 - orderStatus: '待支付', note: note.value, orderItemMainInfoAddRequestList: toRaw(totalInfo.value) } }) - console.log('后台返回订单响应==>',resOrder); + console.log('后台返回订单响应==>',resOrder.data.data); if(resOrder.data.code === 1) { - uni.navigateTo({ - url: '/pages/mine/OrderDetails/OrderDetails' - }) - } else { - uni.showToast({ - icon: 'error', - title: "购买失败,请求错误" - }) - return; + wxPay(resOrder.data.data) } } //根据商品id和购买数量获取商品信息 @@ -306,7 +296,50 @@ const addNum =(index)=>{ sumprice.value += productArr.value[index].goodVO.price * 1 } } - +const wxPay = async( oid )=> { //传入订单id + try { + const res = await uni.request({ + url: baseUrl + '/wechat/payment/create', + method: 'POST', + header: { + 'cookie': wx.getStorageSync("cookie") + }, + data: { id: oid } + }) + const paymentData = res.data.data + wx.requestPayment({ + appid: paymentData.appId, + nonceStr: paymentData.nonceStr, + package: paymentData.packageVal, + paySign: paymentData.paySign, + timeStamp: paymentData.timeStamp, + signType: paymentData.signType, + success(res) { + uni.showModal({ + content: '支付成功', + showCancel: false + }) + uni.navigateTo({ + url: '/pages/order/product-paysuccess/product-paysuccess' + }) + console.log(res); + }, + fail(e) { + uni.showModal({ + content: '支付失败,原因为:' + e.errMsg, + showCancel: false + }) + console.log(e.errMsg); + } + }) + }catch(error) { + console.error('支付请求失败',error); + uni.showModal({ + content: '支付请求失败,请重试。', + showCancel: false + }) + } +} </script> <style lang="scss" scoped> diff --git a/pages/store-home/ProductDetails/ProductDetails.vue b/pages/store-home/ProductDetails/ProductDetails.vue index 4ab7bc8..eb97a28 100644 --- a/pages/store-home/ProductDetails/ProductDetails.vue +++ b/pages/store-home/ProductDetails/ProductDetails.vue @@ -107,6 +107,7 @@ onMounted(()=>{ emitter.on('close',()=>{ //将关闭弹窗方法传入组件 close() }) + getFonts() }) const loadPop =()=>{ popup.value.open('bottom') //从底部弹出 @@ -122,7 +123,19 @@ const jump_buy =()=> { url: '../../../pages/order/product-waitpay/product-waitpay?cartInfo=' + JSON.stringify(idInfo.value) }) } - +//获取字体 +const getFonts =()=>{ + uni.loadFontFace({ + family: 'FangZhengFonts', + source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/FangZhengFonts.TTF")`, + success:(res) =>{ + console.log('success',res); + }, + fail:(err) => { + console.log('err',err); + } + }) +} </script> <style lang="scss" scoped> @@ -136,7 +149,7 @@ const jump_buy =()=> { margin-left: 16.88rpx; } .page { - background-image: url('https://ide.code.fun/api/image?token=675941ee797f850011f20adf&name=69a62ece11618fa91f823c29e896204c.png'); + background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png'); background-size: 100% 100%; background-repeat: no-repeat; height: 100%; @@ -161,7 +174,7 @@ const jump_buy =()=> { } .font { font-size: 26.25rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; line-height: 25.84rpx; color: #323232; } @@ -172,7 +185,7 @@ const jump_buy =()=> { .text { color: #ff0000; font-size: 45rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; line-height: 30.06rpx; } .group_2 { @@ -181,7 +194,7 @@ const jump_buy =()=> { .text_4 { color: #323232; font-size: 33.75rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; line-height: 32.7rpx; } .group_3 { @@ -208,7 +221,7 @@ const jump_buy =()=> { } .font_2 { font-size: 26.25rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; line-height: 31.88rpx; color: #323232; } @@ -231,7 +244,7 @@ const jump_buy =()=> { } .font_3 { font-size: 22.5rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; line-height: 21.71rpx; color: #323232; } @@ -276,7 +289,7 @@ const jump_buy =()=> { } .font_4 { font-size: 30rpx; - font-family: FZSongKeBenXiuKaiS-R-GB; + font-family: 'FangZhengFonts'; color: #ffffff; } .text_10 { diff --git a/pages/store-home/main/main.vue b/pages/store-home/main/main.vue index 199d388..7635b7c 100644 --- a/pages/store-home/main/main.vue +++ b/pages/store-home/main/main.vue @@ -4,7 +4,7 @@ <text class="text">商品</text> <view class="flex-row items-center section_2 ml-15"> <image class="image" - :src="sousuokuang" /> + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FojVVqfyX-sousuo.png" /> <input class="text-wrapper ml-3" placeholder="请输入内容" /> </view> </view> @@ -47,7 +47,7 @@ <text class="font mt-13">¥{{ item.price }}</text> </view> <image class="self-start image_5" - :src="add_img" /> + src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FRcPadqFv-add.png" /> </view> </scroll-view> </view> @@ -116,6 +116,7 @@ const changeTypes = async (item , index) =>{ cookie, } }) + console.log('类别下的商品--->',res.data.data); if(res.data.code === 1) { productList.value = res.data.data[item.id] } else {