Browse Source

feat: 新增订单创建、支付及商品详情功能,优化用户界面和交互体验

- 新增订单创建、支付、快捷下单等功能
- 优化商品详情页展示,支持商品信息动态加载
- 调整用户中心界面,新增佣金和余额展示
- 修复地址管理模块的字段命名问题
- 更新API接口路径,适配新后端服务
- 删除冗余页面和代码,提升代码可维护性
master
前端-胡立永 1 month ago
parent
commit
1d1d496133
33 changed files with 3494 additions and 1061 deletions
  1. +4
    -1
      .cursor/rules/md.mdc
  2. +4
    -1
      App.vue
  3. +1
    -1
      api/api.js
  4. +93
    -3
      api/model/index.js
  5. +3
    -3
      api/model/login.js
  6. +1931
    -0
      apijson.json
  7. +0
    -4
      components/base/tabbar.vue
  8. +2
    -2
      config.js
  9. +8
    -8
      pages.json
  10. +33
    -53
      pages/index/category.vue
  11. +105
    -80
      pages/index/center.vue
  12. +82
    -66
      pages/index/index.vue
  13. +1
    -0
      pages/index/order.vue
  14. +4
    -4
      pages_order/auth/wxLogin.vue
  15. +0
    -331
      pages_order/center/help.vue
  16. +2
    -2
      pages_order/components/address/addressList.vue
  17. +3
    -3
      pages_order/components/address/redactAddress.vue
  18. +1
    -1
      pages_order/components/product/submit.vue
  19. +1
    -1
      pages_order/components/product/submitUnitSelect.vue
  20. +4
    -4
      pages_order/mine/address.vue
  21. +61
    -18
      pages_order/mine/help.vue
  22. +12
    -10
      pages_order/mine/individualTeam.vue
  23. +266
    -0
      pages_order/mine/promotion.vue
  24. +805
    -0
      pages_order/order/createOrder.vue
  25. +16
    -46
      pages_order/order/pictureOrder.vue
  26. +0
    -362
      pages_order/order/refundsOrExchange.vue
  27. +17
    -47
      pages_order/order/voiceOrder.vue
  28. +34
    -9
      pages_order/product/productDetail.vue
  29. BIN
      pages_order/static/createOrder/account.png
  30. BIN
      pages_order/static/createOrder/address.png
  31. BIN
      pages_order/static/createOrder/coupon.png
  32. BIN
      pages_order/static/createOrder/wx.png
  33. +1
    -1
      store/store.js

+ 4
- 1
.cursor/rules/md.mdc View File

@ -3,4 +3,7 @@ description:
globs: globs:
alwaysApply: false alwaysApply: false
--- ---
请你写代码之前先查看一下README.md文件,按照这个文件中说的写
请你写代码之前先查看一下README.md文件,按照这个文件中说的写
## 对接接口的时候,请你先仔细看一下根目录apijson.json文件,这个是接口文档的数据

+ 4
- 1
App.vue View File

@ -3,7 +3,10 @@
onLaunch: function() { onLaunch: function() {
}, },
onShow: function() { onShow: function() {
// this.$store.commit('initConfig')
this.$store.commit('initConfig')
if(uni.getStorageSync('token')){
this.$store.commit('getQrCode')
}
}, },
onHide: function() { onHide: function() {
} }


+ 1
- 1
api/api.js View File

@ -14,7 +14,7 @@ const config = {
// limit : 1000 // limit : 1000
// }, // },
getConfig : {url : '/config_common/getConfig', method : 'GET', limit : 500},
getConfig : {url : '/conf/getConfig', method : 'GET', limit : 500},
} }


+ 93
- 3
api/model/index.js View File

@ -1,6 +1,4 @@
// 登录相关接口
// 接口
const api = { const api = {
// 获取banner // 获取banner
@ -23,6 +21,98 @@ const api = {
url: '/index/getProductList', url: '/index/getProductList',
method: 'GET', method: 'GET',
}, },
// 创建订单
createOrder: {
url: '/index/createOrder',
method: 'POST',
limit : 1000,
},
// 支付订单
payOrder: {
url: '/index/payOrder',
method: 'POST',
},
// 快捷下单
addOrder: {
url: '/index/addOrder',
method: 'POST',
limit : 1000,
},
// 获取快捷下单信息
getOrderInfo: {
url: '/index/getOrderInfo',
method: 'GET',
},
// 获取订单列表
getOrderPageBean: {
url: '/order/getOrderPageBean',
method: 'GET',
},
// 获取订单详情
getOrderInfoById: {
url: '/order/getOrderInfo',
method: 'GET',
},
// 确认收货
confirmOrder: {
url: '/order/confirmOrder',
method: 'POST',
limit : 1000,
},
// 再次支付
payOrderAgain: {
url: '/order/payOrder',
method: 'POST',
limit : 1000,
},
// 更新用户信息
updateUserInfo: {
url: '/info/updateUserInfo',
method: 'POST',
},
// 获取地址列表
getAddressList: {
url: '/info/getAddressList',
method: 'GET',
},
// 获取地址详情
getAddressInfo: {
url: '/info/getAddressInfo',
method: 'GET',
},
// 保存或更新地址
saveOrUpdateAddress: {
url: '/info/saveOrUpdateAddress',
method: 'POST',
limit : 1000,
},
// 删除地址
deleteAddress: {
url: '/info/deleteAddress',
method: 'POST',
},
// 获取流水日志
getLogList: {
url: '/info/getLogList',
method: 'GET',
},
// 获取团队列表
getTeamList: {
url: '/info/getTeamList',
method: 'GET',
},
// 提现
openMoney: {
url: '/info/openMoney',
method: 'POST',
limit : 1000,
},
// 添加帮助
addHelp: {
url: '/info/addHelp',
method: 'POST',
limit : 1000,
},
} }
export default api export default api

+ 3
- 3
api/model/login.js View File

@ -11,13 +11,13 @@ const api = {
}, },
// 获取绑定手机号码 // 获取绑定手机号码
bindPhone: { bindPhone: {
url: '/login_common/bindPhone',
url: '/all_login/bindPhone',
method: 'GET', method: 'GET',
auth: true, auth: true,
}, },
// 修改个人信息接口 // 修改个人信息接口
updateInfo: { updateInfo: {
url: '/info_common/updateInfo',
url: '/info/updateUserInfo',
method: 'POST', method: 'POST',
auth: true, auth: true,
limit : 500, limit : 500,
@ -25,7 +25,7 @@ const api = {
}, },
// 获取个人信息 // 获取个人信息
getInfo: { getInfo: {
url: '/info_common/getInfo',
url: '/info/getUserInfo',
method: 'GET', method: 'GET',
auth: true, auth: true,
}, },


+ 1931
- 0
apijson.json
File diff suppressed because it is too large
View File


+ 0
- 4
components/base/tabbar.vue View File

@ -17,14 +17,10 @@
</template> </template>
<script> <script>
import {
mapGetters
} from 'vuex'
export default { export default {
name: "tabbar", name: "tabbar",
props: ['select'], props: ['select'],
computed: { computed: {
...mapGetters(['userShop']),
}, },
data() { data() {
return { return {


+ 2
- 2
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置 // 环境配置
@ -16,7 +16,7 @@ const config = {
baseUrl : 'http://h5.xzaiyp.top/building-admin', baseUrl : 'http://h5.xzaiyp.top/building-admin',
}, },
prod : { prod : {
baseUrl : 'http://h5.xzaiyp.top/building-admin',
baseUrl : 'https://building-admin.hhlm1688.com/building-admin',
} }
} }


+ 8
- 8
pages.json View File

@ -61,18 +61,12 @@
{ {
"path": "product/productDetail" "path": "product/productDetail"
}, },
{
"path": "order/refundsOrExchange"
},
{ {
"path": "auth/wxLogin" "path": "auth/wxLogin"
}, },
{ {
"path": "auth/wxUserInfo" "path": "auth/wxUserInfo"
}, },
{
"path": "auth/loginAndRegisterAndForgetPassword"
},
{ {
"path": "mine/help" "path": "mine/help"
}, },
@ -89,13 +83,19 @@
"path": "order/firmOrder" "path": "order/firmOrder"
}, },
{ {
"path": "mine/individualTeam"
"path": "order/createOrder"
},
{
"path": "mine/individualTeam",
"style": {
"navigationBarTextStyle": "white"
}
}, },
{ {
"path": "center/systemSet" "path": "center/systemSet"
}, },
{ {
"path": "center/help"
"path": "mine/promotion"
} }
] ]
}], }],


+ 33
- 53
pages/index/category.vue View File

@ -6,6 +6,7 @@
<uv-vtabs <uv-vtabs
:chain="chain" :chain="chain"
:list="category" :list="category"
keyName="title"
:barItemBadgeStyle="{right:'20px',top:'12px'}" :barItemBadgeStyle="{right:'20px',top:'12px'}"
@change="change"> @change="change">
<uv-vtabs-item> <uv-vtabs-item>
@ -14,14 +15,14 @@
</view> </view>
<view class="list"> <view class="list">
<view class="item" v-for="(item,index) in list" :key="index" <view class="item" v-for="(item,index) in list" :key="index"
@click="$utils.navigateTo('/pages_order/product/productDetail?id=123')">
@click="$utils.navigateTo(`/pages_order/product/productDetail?id=${item.id}`)">
<view class="item-image"> <view class="item-image">
<image <image
:src="item.image" :src="item.image"
mode="aspectFill"></image> mode="aspectFill"></image>
</view> </view>
<view class="item-unit"> <view class="item-unit">
<text class="text">{{item.unit}}</text>
<text class="text">{{item.name}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -42,55 +43,8 @@
}, },
data() { data() {
return { return {
category: [
{
name : '桌布'
},
{
name : '桌布'
},
{
name : '桌布'
},
],
list : [
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
{
unit : '100*50*60',
image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
},
],
category: [],
list: [],
chain: false, chain: false,
value: 0 value: 0
} }
@ -101,13 +55,39 @@
return _list ? _list : []; return _list ? _list : [];
} }
}, },
onReady() {
onLoad() {
this.getCategory()
}, },
methods: { methods: {
//
getCategory() {
this.$api('getIcon', res => {
if(res.code == 200) {
this.category = res.result
if(this.category.length > 0) {
this.getProductList(this.category[0].id)
}
}
})
},
//
getProductList(shopIconId) {
this.$api('getProductList', {
shopIconId: shopIconId,
pageNo: 1,
pageSize: 99999
}, res => {
if(res.code == 200) {
this.list = res.result.records
}
})
},
change(index) { change(index) {
console.log('选项改变:', index) console.log('选项改变:', index)
this.value = index; this.value = index;
if(this.category[index]) {
this.getProductList(this.category[index].id)
}
} }
} }
} }


+ 105
- 80
pages/index/center.vue View File

@ -5,25 +5,31 @@
<view class="head"> <view class="head">
<view class="headImage"> <view class="headImage">
<image src="/static/image/center/headImage.png" mode=""></image>
<image :src="userInfo.headImage || '/static/image/center/headImage.png'" mode=""></image>
</view> </view>
<view class="info"> <view class="info">
<view class="name">
倾心.
</view>
<view class="headBtn" @click="headBtn">
修改资料
<view v-if="isLogin">
<view style="display: flex;gap: 20rpx;">
<view class="name">
{{userInfo.nickName || '未登录'}}
</view>
<view class="headBtn" @click="$utils.navigateTo('/pages_order/auth/wxUserInfo')">
修改资料
<uv-icon name="edit-pen-fill" size="26rpx" color="#fff"></uv-icon>
</view>
</view>
<view class="tips">
手机号<text>{{userInfo.phone || '未绑定'}}</text>
</view>
</view> </view>
<!-- <view class="vip">
VIP1
</view> -->
<view class="tips">
手机号<text>1387451383</text>
<view v-else>
<view class="login-btn" @tap.stop="$utils.toLogin()">
<text>立即登录</text>
</view>
</view> </view>
</view> </view>
<view class="amend">
<uv-icon name="edit-pen-fill" size="26rpx" color="#fff"></uv-icon>
</view>
</view> </view>
<!-- 酒店 --> <!-- 酒店 -->
@ -35,7 +41,7 @@
</view> </view>
<view class=""> <view class="">
我的佣金 我的佣金
<p style="color:#DC2828; font-weight: 700;">240</p>
<p style="color:#DC2828; font-weight: 700;">{{commission}}</p>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
@ -44,7 +50,7 @@
</view> </view>
<view class=""> <view class="">
我的金额 我的金额
<p style="color:#DC2828;font-weight: 700">1200</p>
<p style="color:#DC2828;font-weight: 700">{{balance}}</p>
</view> </view>
</view> </view>
</view> </view>
@ -52,9 +58,10 @@
<view class="image-home"> <view class="image-home">
<uv-swiper <uv-swiper
class="uv-swaip" class="uv-swaip"
height="300rpx"
:list="list"
height="240rpx"
:list="bannerList"
circular circular
keyName="image"
indicator="true" indicator="true"
bgColor="#ffffff"> bgColor="#ffffff">
</uv-swiper> </uv-swiper>
@ -80,38 +87,39 @@
<image class="image" src="/static/image/center/8.png" mode=""></image> <image class="image" src="/static/image/center/8.png" mode=""></image>
<text class="grid-text">我的团队</text> <text class="grid-text">我的团队</text>
</uv-grid-item> </uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+1)">
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/firmOrder')">
<image class="image" src="/static/image/center/7.png" mode=""></image> <image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">快捷订单</text> <text class="grid-text">快捷订单</text>
</uv-grid-item> </uv-grid-item>
<uv-grid-item @click="contactUs">
<uv-grid-item @click="$utils.navigateTo('/pages_order/mine/promotion')">
<image class="image" src="/static/image/center/9.png" mode=""></image> <image class="image" src="/static/image/center/9.png" mode=""></image>
<text class="grid-text">邀请好友</text> <text class="grid-text">邀请好友</text>
</uv-grid-item> </uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/center/systemSet')">
<!-- <uv-grid-item @click="$utils.navigateTo('/pages_order/center/systemSet')">
<image class="image" src="/static/image/center/6.png" mode=""></image> <image class="image" src="/static/image/center/6.png" mode=""></image>
<text class="grid-text">系统设置</text> <text class="grid-text">系统设置</text>
</uv-grid-item>
</uv-grid-item> -->
<uv-grid-item @click="$utils.navigateTo('/pages_order/center/help')">
<uv-grid-item @click="$utils.navigateTo('/pages_order/mine/help')">
<image class="image" src="/static/image/center/7.png" mode=""></image> <image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">帮助与反馈</text> <text class="grid-text">帮助与反馈</text>
</uv-grid-item> </uv-grid-item>
<uv-grid-item <uv-grid-item
@click="$utils.navigateTo('/pages_order/auth/loginAndRegisterAndForgetPassword?index='+2)">
@click="$utils.navigateTo('/pages_order/auth/')">
<image class="image" src="/static/image/center/7.png" mode=""></image> <image class="image" src="/static/image/center/7.png" mode=""></image>
<text class="grid-text">关于本程序</text> <text class="grid-text">关于本程序</text>
</uv-grid-item> </uv-grid-item>
<uv-grid-item @click="$utils.navigateTo('/pages_order/order/refundsOrExchange?index='+0)">
<image class="image" src="/static/image/center/5.png" mode=""></image>
<text class="grid-text">联系客服</text>
<uv-grid-item>
<button open-type="contact" class="share">
<image class="image" src="/static/image/center/5.png" mode=""></image>
<text class="grid-text">联系客服</text>
</button>
</uv-grid-item> </uv-grid-item>
</uv-grid> </uv-grid>
</view> </view>
@ -126,20 +134,34 @@
export default { export default {
components: { components: {
tabber, tabber,
}, },
computed: { computed: {
}, },
data() { data() {
return { return {
list: [
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
]
list: [],
commission: 0, //
balance: 0, //
isLogin: false, //
bannerList : [],
} }
}, },
onShow() {
if(uni.getStorageSync('token')){
this.$store.commit('getUserInfo')
this.isLogin = true;
}
this.getBanner()
},
methods: { methods: {
//
getBanner() {
this.$api('getBanner', res => {
if (res.code == 200) {
this.bannerList = res.result
}
})
},
} }
} }
</script> </script>
@ -196,7 +218,6 @@
} }
.head { .head {
z-index: -1;
display: flex; display: flex;
background-color: #DC2828; background-color: #DC2828;
padding: 0rpx 20rpx; padding: 0rpx 20rpx;
@ -231,6 +252,11 @@
.name { .name {
font-size: 36rpx; font-size: 36rpx;
color: #fff; color: #fff;
margin-right: 20rpx;
width: 240rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.tips { .tips {
@ -238,59 +264,31 @@
color: #fff; color: #fff;
margin-top: 10rpx; margin-top: 10rpx;
} }
.login-btn {
margin-top: 20rpx;
background-color: #fff;
color: #DC2828;
padding: 10rpx 30rpx;
border-radius: 30rpx;
font-size: 28rpx;
display: inline-block;
width: 160rpx;
text-align: center;
}
} }
.headBtn { .headBtn {
position: absolute;
left: 310rpx;
top: 175rpx;
color: #FFF; color: #FFF;
font-size: 26rpx; font-size: 26rpx;
}
.amend {
position: absolute;
left: 275rpx;
top: 180rpx;
}
}
.userShop {
.userList {
.title {
font-size: 32rpx;
font-weight: 900;
padding: 20rpx;
}
.list {
display: flex;
flex-wrap: wrap;
.item {
width: 270rpx;
margin: 20rpx;
display: flex;
flex-direction: column;
padding: 40rpx 30rpx;
background-color: #fff;
border-radius: 30rpx;
line-height: 60rpx;
.name {}
.num {
color: $uni-color;
font-weight: 600;
font-size: 28rpx;
}
}
}
display: flex;
align-items: center;
} }
} }
.user { .user {
z-index: 99;
position: relative;
z-index: 9;
margin: 0 30rpx; margin: 0 30rpx;
margin-top: -60rpx; margin-top: -60rpx;
.line { .line {
@ -319,7 +317,6 @@
} }
.image-home{ .image-home{
z-index: 1; z-index: 1;
height: 300rpx;
width: 100%; width: 100%;
} }
} }
@ -346,6 +343,34 @@
width: 120rpx; width: 120rpx;
font-size: 24rpx; font-size: 24rpx;
} }
.share {
background: none;
padding: 0;
margin: 0;
line-height: normal;
border: none;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&::after {
border: none;
}
.image {
width: 50rpx;
height: 50rpx;
margin: 20rpx 0;
}
.grid-text {
text-align: center;
width: 120rpx;
font-size: 24rpx;
}
}
} }
} }
</style> </style>

+ 82
- 66
pages/index/index.vue View File

@ -26,65 +26,43 @@
</view> </view>
<view class="image-home"> <view class="image-home">
<uv-swiper class="uv-swaip" height="350rpx" :list="bannerList" circular bgColor="#ffffff">
<uv-swiper class="uv-swaip"
keyName="image"
height="350rpx" :list="bannerList" circular bgColor="#ffffff">
</uv-swiper> </uv-swiper>
</view> </view>
<view class="building-class"> <view class="building-class">
<view style="width: 710rpx;"> <view style="width: 710rpx;">
<uv-grid :col="4" :border="false"> <uv-grid :col="4" :border="false">
<uv-grid-item>
<image class="image" src="../../static/image/home/3.png" mode=""></image>
<text class="grid-text">XX建材</text>
</uv-grid-item>
<uv-grid-item>
<image class="image" src="../../static/image/home/4.png" mode=""></image>
<text class="grid-text">XX建材</text>
</uv-grid-item>
<uv-grid-item>
<image class="image" src="../../static/image/home/5.png" mode=""></image>
<text class="grid-text">XX建材</text>
</uv-grid-item>
<uv-grid-item>
<image class="image" src="../../static/image/home/6.png" mode=""></image>
<text class="grid-text">XX建材</text>
<uv-grid-item v-for="(item, index) in menuList" :key="index"
@click="menuClick(item)">
<image class="image" :src="item.image" mode=""></image>
<text class="grid-text">{{item.title}}</text>
</uv-grid-item> </uv-grid-item>
</uv-grid> </uv-grid>
</view> </view>
</view> </view>
<view class="hot-building"> <view class="hot-building">
<text>热卖建材</text> <text>热卖建材</text>
</view> </view>
<view class="quick-order-container" @click="toUrl">
<view class="new-message">
你有一条新的快捷下单信息
</view>
<view class="quick-order">
<view class="number-order">
1
</view>
<image src="../../static/image/home/7.png" mode=""></image>
</view>
</view>
<view class="shop-list" v-for="(item, index) in 20" @click="toGoodInfo(item, index)" :key="index">
<view class="shop-list" v-for="(item, index) in list" @click="toGoodInfo(item, index)" :key="index">
<view class="picture-shop"> <view class="picture-shop">
<image src="../../static/image/home/8.png" mode=""></image>
<image :src="item.image" mode=""></image>
</view> </view>
<view class="price-shop"> <view class="price-shop">
<view class="top-shop"> <view class="top-shop">
<text>泰山工装石膏板</text>
<text>{{item.name}}</text>
<view class="tag-shop"> <view class="tag-shop">
<uv-tags text="建材材料" type="warning" plain size="mini"></uv-tags>
<uv-tags :text="item.categoryName" type="warning" plain size="mini"></uv-tags>
<uv-tags text="快速下单" type="warning" plain size="mini"></uv-tags> <uv-tags text="快速下单" type="warning" plain size="mini"></uv-tags>
</view> </view>
</view> </view>
<view class="bottom-price"> <view class="bottom-price">
<text style="font-size: 40rpx; ">38</text>.00/
<text style="font-size: 40rpx; ">{{item.price}}</text>/{{item.unit}}
</view> </view>
</view> </view>
<view class="buy-shop"> <view class="buy-shop">
@ -96,6 +74,18 @@
</view> </view>
<PrivacyAgreementPoup /> <PrivacyAgreementPoup />
<view class="quick-order-container" @click="toUrl">
<view class="new-message" v-if="false">
你有一条新的快捷下单信息
</view>
<view class="quick-order">
<view class="number-order" v-if="false">
1
</view>
<image src="../../static/image/home/7.png" mode=""></image>
</view>
</view>
<tabber select="home" /> <tabber select="home" />
</view> </view>
@ -115,15 +105,27 @@ export default {
return { return {
keyword: '', keyword: '',
bannerList : [], bannerList : [],
mixinsListApi: 'getClassShopPageList',
menuList: [],
mixinsListApi: 'getProductList',
} }
}, },
computed: { computed: {
}, },
onLoad() {
onShow() {
this.getBanner() this.getBanner()
this.getMenu()
if(uni.getStorageSync('token')){
this.getOrderInfo()
}
}, },
methods: { methods: {
//
getOrderInfo(){
this.$api('getOrderInfo')
.then(res => {
})
},
// //
getBanner() { getBanner() {
this.$api('getBanner', res => { this.$api('getBanner', res => {
@ -132,20 +134,32 @@ export default {
} }
}) })
}, },
//
getMenu() {
this.$api('getIcon', res => {
if (res.code == 200) {
this.menuList = res.result
}
})
},
toUrl() { toUrl() {
uni.navigateTo({ uni.navigateTo({
url: '/pages_order/order/fastCreateOrder' url: '/pages_order/order/fastCreateOrder'
}) })
// this.$utils.navigateTo('/pages_order/mine/address')
}, },
toGoodInfo(item, index) { toGoodInfo(item, index) {
// uni.navigateTo({
// url: `/pages_order/order/product/productDetail?id=`+item.id
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages_order/product/productDetail'
url: `/pages_order/product/productDetail?id=${item.id}`
}) })
}, },
menuClick(item){
if(!item.url){
return
}
uni.navigateTo({
url: item.url,
})
},
} }
} }
</script> </script>
@ -246,7 +260,6 @@ export default {
.image-home { .image-home {
z-index: 1; z-index: 1;
height: 350rpx;
margin: 0 20rpx; margin: 0 20rpx;
margin-top: -90rpx; margin-top: -90rpx;
border-radius: 20rpx; border-radius: 20rpx;
@ -269,8 +282,8 @@ export default {
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
width: 100rpx;
height: 100rpx;
width: 90rpx;
height: 90rpx;
display: inline-block; display: inline-block;
transition: transform 0.3s; transition: transform 0.3s;
@ -279,7 +292,8 @@ export default {
} }
} }
:deep(.grid-text) {
.grid-text {
margin-top: 4rpx;
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
@ -326,7 +340,7 @@ export default {
.quick-order-container { .quick-order-container {
position: fixed; position: fixed;
right: 30rpx; right: 30rpx;
top: 40vh;
bottom: 30vh;
z-index: 99; z-index: 99;
transition: transform 0.3s; transition: transform 0.3s;
@ -411,7 +425,7 @@ export default {
.top-shop { .top-shop {
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
font-size: 30rpx;
font-size: 32rpx;
margin-top: 20rpx; margin-top: 20rpx;
text-align: center; text-align: center;
font-weight: 600; font-weight: 600;
@ -427,29 +441,31 @@ export default {
.bottom-price { .bottom-price {
display: inline-block; display: inline-block;
color: #DC2828;
height: 80rpx;
width: 250rpx;
line-height: 100rpx;
}
}
.buy-shop {
height: 100%;
width: 250rpx;
display: flex;
justify-content: center;
align-items: center;
:deep(.uv-button) {
transition: transform 0.2s;
&:active {
transform: scale(0.95);
font-size: 28rpx;
color: #666;
text {
color: #DC2828;
font-weight: 700;
} }
} }
} }
} }
.buy-shop {
height: 100%;
width: 250rpx;
display: flex;
justify-content: center;
align-items: center;
:deep(.uv-button) {
transition: transform 0.2s;
&:active {
transform: scale(0.95);
}
}
}
@keyframes pulse { @keyframes pulse {
0% { 0% {


+ 1
- 0
pages/index/order.vue View File

@ -8,6 +8,7 @@
lineColor="#FD5100" lineColor="#FD5100"
lineHeight="8rpx" lineHeight="8rpx"
lineWidth="50rpx" lineWidth="50rpx"
:scrollable="false"
@click="clickTabs"></uv-tabs> @click="clickTabs"></uv-tabs>
<view v-if="orderList.records.length > 0" class="list"> <view v-if="orderList.records.length > 0" class="list">


+ 4
- 4
pages_order/auth/wxLogin.vue View File

@ -1,10 +1,10 @@
<template> <template>
<view class="login"> <view class="login">
<view class="logo"> <view class="logo">
<image src="/static/image/login/logo.png" mode=""></image>
<image :src="configList.logo_image" mode=""></image>
</view> </view>
<view class="title"> <view class="title">
欢迎使用酒店桌布租赁平台
欢迎使用{{ configList.logo_name }}
</view> </view>
<view class="btn mt" <view class="btn mt"
@click="wxLogin"> @click="wxLogin">
@ -35,10 +35,10 @@
activeColor="#FD5100" activeColor="#FD5100"
:name="1" :name="1"
></uv-checkbox> ></uv-checkbox>
阅读并同意我们的<text @click="openConfigDetail('getPrivacyPolicy')">服务协议与隐私条款</text>
阅读并同意我们的<text @click="openConfigDetail('user_xy')">用户协议</text>
</view> </view>
<view class=""> <view class="">
以及<text @click="openConfigDetail('getUserAgreement')">个人信息保护指引</text>
以及<text @click="openConfigDetail('user_ys')">隐私政策</text>
</view> </view>
</view> </view>
</uv-checkbox-group> </uv-checkbox-group>


+ 0
- 331
pages_order/center/help.vue View File

@ -1,331 +0,0 @@
<template>
<!-- 帮助与反馈 -->
<view class="help">
<navbar title="帮助与反馈" leftClick @leftClick="$utils.navigateBack" />
<view class="help-box">
<view>
<view class="help-issue">
<text>问题和意见</text>
<text style="color: #BD3624;">*</text>
</view>
<uv-textarea v-model="value" :count="true" border="none" height="400"
placeholder="请把发现的问题提交给我们,感谢您的参与(必填)"
:text-style="{color:'#BCB7B7',fontSize:'28rpx'}" />
</view>
<view>
<view class="help-issue">
<text>问题截图</text>
<text style="color: #BD3624;">*</text>
</view>
<view class="help-screenshot">
<uv-upload :fileList="fileList" multiple :maxCount="3" width="180rpx"
height="180rpx" multiple @afterRead="afterRead" @delete="deleteImage">
<image src="../static/help/uploading.png" mode="aspectFill"
style="width: 180rpx;height: 180rpx;" />
</uv-upload>
</view>
</view>
<!-- <view>
<view class="help-issue">
<text>联系方式</text>
<text style="color: #BD3624;">*</text>
</view>
<uv-input placeholder="请输入联系方式" fontSize="24rpx" border="bottom"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系姓名" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
<uv-input placeholder="请输入联系姓名" border="none" fontSize="24rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系方式" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
</view> -->
<view class="help-button">
<view>确认</view>
</view>
</view>
</view>
</template>
<template>
<view class="page">
<navbar title="帮助与反馈" leftClick @leftClick="$utils.navigateBack"/>
<view class="frame">
<!--帮助与反馈-->
<view class="helpFeedback">
<view class="title"> 问题和意见 <span style="color: red;">*</span></view>
<view class="desc">
<textarea placeholder="请把发现的问题提交给我们,感谢您的参与(必填)"/>
</view>
</view>
<!--问题截图-->
<view class="problemImg">
<view class="title">问题截图<span style="color: red;">*</span></view>
<view class="img">
<uv-upload
:fileList="fileList"
:maxCount="5"
multiple
width="150rpx"
height="150rpx"
@delete="deleteImage"
@afterRead="afterRead"
:previewFullImage="true">
</uv-upload>
</view>
</view>
<!--联系方式-->
<view class="name_phone">
<view class="title">联系方式<span style="color: red;">*</span></view>
<view class="items">
<view class="item">
<view>联系姓名</view>
<view>
<input placeholder="请输入联系姓名" clearable></input>
</view>
</view>
<view class="item">
<view>联系电话</view>
<view>
<input placeholder="请输入联系电话" clearable></input>
</view>
</view>
</view>
</view>
<!--提交反馈-->
<view class="btns">
<view @click="submitFeedback" class="btn">
提交反馈
</view>
</view>
</view>
</view>
</template>
<script>
import topbar from "@/components/base/topbar.vue";
import tabber from "@/components/base/tabbar.vue";
export default {
name: "helpFeedback",
components: {tabber, topbar},
data() {
return {
fileList: [],
}
},
methods: {
//
submitFeedback() {
},
deleteImage(e) {
this.fileList.splice(e.index, 1)
},
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
},
}
</script>
<style scoped lang="scss">
.page {
height: 100vh;
background-color: #f2f5f5;
.frame {
padding: 40rpx;
display: flex;
flex-direction: column;
justify-content: center;
gap: 40rpx;
.helpFeedback {
.title {
}
.desc {
margin-top: 20rpx;
height: 300rpx;
border-radius: 40rpx;
overflow: hidden;
padding: 20rpx;
font-size: 28rpx;
background-color: #fff;
}
}
.problemImg {
.img {
margin-top: 20rpx;
height: 150rpx;
border-radius: 40rpx;
overflow: hidden;
padding: 20rpx;
font-size: 28rpx;
background-color: #fff;
}
}
.name_phone {
.title {
}
.items {
margin-top: 20rpx;
.item {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 10rpx 0 0 20rpx;
border-bottom: 1px solid #efefef;
> view:nth-of-type(1) {
width: 30%;
// font-weight: 700;
}
> view:nth-of-type(2) {
width: 70%;
border-radius: 10rpx;
overflow: hidden;
input {
background-color: #FFF;
font-size: 28rpx;
padding: 16rpx 8rpx 16rpx 15rpx;
}
}
}
}
}
.btns {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 20rpx;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 500rpx;
height: 70rpx;
border-radius: 40rpx;
color: #FFF;
font-size: 28rpx;
margin: 20rpx 10rpx 0 0;
background: $uni-color;
//margin-top: 20rpx;
border-radius: 40rpx;
}
}
}
}
</style>
<script>
export default {
data() {
return {
value: "",
fileList: []
}
},
onLoad(args) {
},
methods: {
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script>
<style scoped lang="scss">
.help {
.help-box {
width: 92%;
margin-left: 4%;
.help-issue {
margin: 20rpx;
font-size: 28rpx;
font-weight: 600;
color: #333333;
}
.help-screenshot {
display: flex;
align-items: center;
background-color: #fff;
padding: 20rpx;
}
.help-button {
display: flex;
justify-content: center;
font-size: 24rpx;
flex-shrink: 0;
margin-top: 60rpx;
view {
padding: 14rpx 120rpx;
border-radius: 38rpx;
}
view:nth-child(1) {
background: $uni-color;
color: #fff;
}
view:nth-child(2) {
color: #FFFDF6;
background-color: #C83741;
}
}
}
}
</style>

+ 2
- 2
pages_order/components/address/addressList.vue View File

@ -22,7 +22,7 @@
</view> </view>
<view class="address-detail"> <view class="address-detail">
{{ item.address + " " + item.addressDetail }}
{{ item.address + " " + item.addressDetails }}
</view> </view>
</view> </view>
</view> </view>
@ -90,7 +90,7 @@
// //
getAddressList() { getAddressList() {
return new Promise((success, fail) => { return new Promise((success, fail) => {
this.$api('addressPage', this.queryParams, res => {
this.$api('getAddressList', this.queryParams, res => {
if (res.code == 200) { if (res.code == 200) {
this.addressList = res.result.records || []; this.addressList = res.result.records || [];
this.total = res.result.total || 0; this.total = res.result.total || 0;


+ 3
- 3
pages_order/components/address/redactAddress.vue View File

@ -25,7 +25,7 @@
</uv-form-item> </uv-form-item>
<uv-form-item label="详细地址" prop="addressDetail"> <uv-form-item label="详细地址" prop="addressDetail">
<uv-input v-model="addressDetail.addressDetail" placeholder="请输入详细地址" border="none">
<uv-input v-model="addressDetail.addressDetails" placeholder="请输入详细地址" border="none">
</uv-input> </uv-input>
</uv-form-item> </uv-form-item>
</uv-form> </uv-form>
@ -76,7 +76,7 @@
name, name,
phone, phone,
address, address,
addressDetail
addressDetails
} = addressDetaila } = addressDetaila
if (name.trim() == '') { if (name.trim() == '') {
return { return {
@ -93,7 +93,7 @@
title: '请填写所在地区', title: '请填写所在地区',
auth: false auth: false
} }
} else if (addressDetail.trim() == '') {
} else if (addressDetails.trim() == '') {
return { return {
title: '请填写详细地址', title: '请填写详细地址',
auth: false auth: false


+ 1
- 1
pages_order/components/product/submit.vue View File

@ -30,7 +30,7 @@
name:"submit", name:"submit",
props : { props : {
submiitTitle : { submiitTitle : {
default : '立即租赁',
default : '立即购买',
type : String, type : String,
} }
}, },


+ 1
- 1
pages_order/components/product/submitUnitSelect.vue View File

@ -12,7 +12,7 @@
{{ address.name }} {{ address.name }}
</view> </view>
<view class=""> <view class="">
{{ address.addressDetail }}
{{ address.addressDetails }}
</view> </view>
<view class="icon"> <view class="icon">
<uv-icon <uv-icon


+ 4
- 4
pages_order/mine/address.vue View File

@ -77,7 +77,7 @@
name: addressDetail.name, name: addressDetail.name,
phone: addressDetail.phone, phone: addressDetail.phone,
address: addressDetail.address, address: addressDetail.address,
addressDetail: addressDetail.addressDetail,
addressDetails: addressDetail.addressDetails,
defaultId: addressDetail.defaultId || '0', defaultId: addressDetail.defaultId || '0',
latitude: addressDetail.latitude, latitude: addressDetail.latitude,
longitude: addressDetail.longitude longitude: addressDetail.longitude
@ -87,7 +87,7 @@
data.id = addressDetail.id data.id = addressDetail.id
} }
this.$api(data.id ? 'addressEdit' : 'addressAdd', data, res => {
this.$api('saveOrUpdateAddress', data, res => {
if (res.code == 200) { if (res.code == 200) {
this.$refs.addressPopup.close() this.$refs.addressPopup.close()
this.getAddressList() this.getAddressList()
@ -128,7 +128,7 @@
content: '确认删除此地址?删除后数据不可恢复', content: '确认删除此地址?删除后数据不可恢复',
success(e) { success(e) {
if(e.confirm){ if(e.confirm){
self.$api('addressDelete', {
self.$api('deleteAddress', {
id id
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
@ -151,7 +151,7 @@
name: '', name: '',
phone: '', phone: '',
address: '', address: '',
addressDetail: '',
addressDetails: '',
defaultId: '', defaultId: '',
latitude: '', latitude: '',
longitude: '' longitude: ''


+ 61
- 18
pages_order/mine/help.vue View File

@ -8,7 +8,7 @@
<text>问题和意见</text> <text>问题和意见</text>
<text style="color: #BD3624;">*</text> <text style="color: #BD3624;">*</text>
</view> </view>
<uv-textarea v-model="value" :count="true" border="none" height="400"
<uv-textarea v-model="form.title" :count="true" border="none" height="400"
placeholder="请把发现的问题提交给我们,感谢您的参与(必填)" placeholder="请把发现的问题提交给我们,感谢您的参与(必填)"
:text-style="{color:'#BCB7B7',fontSize:'28rpx'}" /> :text-style="{color:'#BCB7B7',fontSize:'28rpx'}" />
</view> </view>
@ -16,7 +16,7 @@
<view> <view>
<view class="help-issue"> <view class="help-issue">
<text>问题截图</text> <text>问题截图</text>
<text style="color: #BD3624;">*</text>
<!-- <text style="color: #BD3624;">*</text> -->
</view> </view>
<view class="help-screenshot"> <view class="help-screenshot">
@ -28,26 +28,27 @@
</view> </view>
</view> </view>
<!-- <view>
<view>
<view class="help-issue"> <view class="help-issue">
<text>联系方式</text> <text>联系方式</text>
<text style="color: #BD3624;">*</text> <text style="color: #BD3624;">*</text>
</view> </view>
<uv-input placeholder="请输入联系方式" fontSize="24rpx" border="bottom"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系姓名" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
<uv-input placeholder="请输入联系姓名" border="none" fontSize="24rpx"
:custom-style="{backgroundColor: '#fff'}">
<template #prefix>
<uv-text text="联系方式" size="24rpx" margin="20rpx 10rpx 20rpx 10rpx" />
</template>
</uv-input>
</view> -->
<view class="form-sheet-cell">
<view>
联系姓名
</view>
<input placeholder="请输入联系姓名" v-model="form.name" />
</view>
<view class="form-sheet-cell">
<view>
联系电话
</view>
<input placeholder="请输入联系电话" v-model="form.phone" />
</view>
</view>
<view class="help-button"> <view class="help-button">
<view>确认</view>
<!-- <view>历史提交</view> -->
<view @click="submit">确认</view>
</view> </view>
</view> </view>
</view> </view>
@ -57,7 +58,12 @@
export default { export default {
data() { data() {
return { return {
value: "",
form : {
title : '',
phone : '',
name : '',
image : '',
},
fileList: [] fileList: []
} }
}, },
@ -78,6 +84,32 @@
}) })
}) })
}, },
submit(){
let data = JSON.parse(JSON.stringify(this.form))
if(this.$utils.verificationAll(this.form, {
title : '请输入你的问题和意见',//
// image : '',//
name : '请输入姓名',//
phone : '请输入手机号码',//
})){
return
}
data.image = this.fileList.map((item) => item.url).join(",")
this.$api('addHelp', data, res => {
if(res.code == 200){
uni.showToast({
title: "反馈成功",
icon:'none'
})
setTimeout(uni.navigateBack, 800, -1)
}
})
},
} }
} }
</script> </script>
@ -101,6 +133,17 @@
background-color: #fff; background-color: #fff;
padding: 20rpx; padding: 20rpx;
} }
.form-sheet-cell{
display: flex;
background-color: #fff;
padding: 20rpx 30rpx;
font-size: 24rpx;
align-items: center;
view{
width: 150rpx;
}
}
.help-button { .help-button {
display: flex; display: flex;


+ 12
- 10
pages_order/mine/individualTeam.vue View File

@ -1,13 +1,12 @@
<template> <template>
<view class="page"> <view class="page">
<!-- <navbar
title="我的团队"
leftClick
@leftClick="$utils.navigateBack"
bgColor="#DC2828"
color="#fff"
/> -->
<navbar title="我的团队" leftClick @leftClick="$utils.navigateBack" />
<navbar
title="我的团队"
leftClick
@leftClick="$utils.navigateBack"
bgColor="#DC2828"
color="#fff"
/>
<view class="team"> <view class="team">
<view class="team-message"> <view class="team-message">
@ -65,17 +64,20 @@
</template> </template>
<script> <script>
import mixinsList from '@/mixins/list.js'
export default { export default {
mixins: [mixinsList],
data() { data() {
return { return {
state: -1, state: -1,
tabs: [{
mixinsListApi: 'getTeamList',
tabs: [
{
name: '直销用户' name: '直销用户'
}, },
{ {
name: '间推用户' name: '间推用户'
}, },
], ],
}; };
}, },


+ 266
- 0
pages_order/mine/promotion.vue View File

@ -0,0 +1,266 @@
<template>
<view class="promotion">
<navbar title="二维码"
bgColor="rgb(235, 51, 0)"
color="#fff"
leftClick @leftClick="$utils.navigateBack" />
<image
class="image"
:src="promotionUrl" mode="aspectFill"></image>
<!-- <canvas id="myCanvas" type="2d" canvas-id="firstCanvas1"></canvas> -->
<view class="btn"
v-if="promotionUrl"
@click="preservationImg(promotionUrl)">
保存到相册
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Promotion',
computed: {
...mapState(['userInfo', 'promotionUrl']),
},
data() {
return {
url: '',
title: '',
baseUrl: 'https://image.hhlm1688.com/',
canvas: {},
imagePath : '',
// imagePath: 'https://image.hhlm1688.com/2025-03-06/32fbb8e2-160b-4cbf-9a49-a72de231de20.png',
// imagePath: 'https://image.hhlm1688.com/2025-02-27/2fe7e417-54ad-4911-b9ba-84ac7d48e66d.png',
// imagePath: 'https://image.hhlm1688.com/2025-02-26/6539d2fa-558d-47db-9681-ecffec5b6c5d.png',
index : 0,
}
},
onShow() {
let that = this;
// that.draw()
if(!that.promotionUrl){
// that.getQrCode()
this.getImageInfo()
}
// that.$store.commit('getUserInfo')
},
methods: {
getImageInfo(){
let that = this;
uni.showLoading({
title: "拼命绘画中..."
})
uni.getImageInfo({
src: `${this.$config.baseUrl}/info/createQrCode?token=${uni.getStorageSync('token')}`,
success : res => {
uni.hideLoading()
that.$store.commit('setPromotionUrl', res.path)
},
fail : err => {
uni.showToast({
icon: 'none',
title: '绘画失败',
})
}
})
},
getQrCode() {
uni.showLoading({
title: "拼命绘画中..."
})
let that = this;
that.$api('getInviteCode', res => {
if (res.code == 200) {
that.url = res.result.url
that.title = res.result.name
that.imagePath = that.$config.aliOss.url + res.result.url
that.$store.commit('setPromotionUrl', that.imagePath)
// that.draw()
uni.hideLoading()
}
})
},
draw() {
uni.showLoading({
title: "拼命绘画中..."
})
let that = this;
wx.createSelectorQuery()
.select('#myCanvas') // canvasid
.fields({
node: true,
size: true
})
.exec((res) => {
console.log("----------1")
const canvas = res[0].node
//
const ctx = canvas.getContext('2d')
// Canvas
const width = res[0].width
const height = res[0].height
console.log(width, height);
//
const dpr = wx.getWindowInfo().pixelRatio
//dpr
// dpr 2 4
// 3 6
let Ratio = dpr * 2
canvas.width = width * dpr
canvas.height = height * dpr
that.canvas = canvas
ctx.scale(dpr, dpr)
ctx.clearRect(0, 0, width, height)
// ctx.fillStyle = '#fff'
// ctx.fillRect(0, 0, canvas.width, canvas.height)
//
const bgImage = canvas.createImage()
bgImage.src = that.configList.qr_code
//
const coderImage = canvas.createImage()
coderImage.src = '../static/logo.png'
// coderImage.src = that.baseUrl + that.url
let size = 0;
console.log("----------2")
bgImage.onload = () => {
canvas.width = bgImage.width
canvas.height = bgImage.height
ctx.drawImage(bgImage,
0, 0, bgImage.width, bgImage.height)
size = Math.floor(canvas.width / 3)
ctx.drawImage(coderImage,
canvas.width / 2 - (size / 2), canvas.height * 0.46, size, size)
that.canvasToTempFilePath()
}
console.log("----------3")
coderImage.onload = () => {
ctx.drawImage(coderImage,
canvas.width / 2 - (size / 2), canvas.height * 0.46, size, size)
that.canvasToTempFilePath()
}
})
},
canvasToTempFilePath(){
let that = this;
that.index++
if(that.index < 2){
return
}
//
setTimeout(() => {
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: that.canvas.width,
height: that.canvas.height,
canvas : that.canvas,
success: (res) => {
var tempFilePath = res.tempFilePath;
that.imagePath = tempFilePath
that.$store.commit('setPromotionUrl', res.tempFilePath)
uni.hideLoading()
that.load = false
}
});
}, 200);
},
back() {
uni.navigateBack(-1)
},
async preservationImg(img) {
await this.$authorize('scope.writePhotosAlbum')
this.imgApi(img);
},
imgApi(image) {
/* 获取图片的信息 */
uni.getImageInfo({
src: image,
success: function(image) {
/* 保存图片到手机相册 */
uni.saveImageToPhotosAlbum({
filePath: image.path,
success: function() {
uni.showModal({
title: '保存成功',
content: '图片已成功保存到相册',
showCancel: false
});
},
complete(res) {
console.log(res);
}
});
}
});
},
}
}
</script>
<style lang="scss" scoped>
.promotion {
width: 100%;
height: 100vh;
background-color: $uni-color;
}
.image{
width: 100%;
height: calc(100vh - 320rpx);
}
#myCanvas {
position: fixed;
left: 100%;
/* visibility: hidden */
/* visibility: hidden; */
/* margin-top: 100rpx; */
width: 750rpx;
height: calc(100vh - 120rpx);
/* line-height: 20px; */
background-color: rgba(255, 255, 255, 1);
text-align: center;
}
.btn{
position: fixed;
// top: 58vh;
bottom: 0;
margin: 0;
width: 750rpx;
height: 100rpx;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
color: $uni-color;
}
</style>

+ 805
- 0
pages_order/order/createOrder.vue View File

@ -0,0 +1,805 @@
<template>
<view class="page">
<!-- 导航栏 -->
<navbar :title="titleMap[type]" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
<view class="bac"></view>
<view class="box">
<!-- 送礼 -->
<view class="give-type" v-if="type == 'give'">
<view class="tab-box">
<view class="tab-item" :class="{'active': isGive === 1}"
@click="isGive = 1">
<text>单人礼包</text>
<text class="desc">送给1位好友可同时送多件礼品</text>
</view>
<view class="tab-item" :class="{'active': isGive === 2}"
@click="isGive = 2">
<text>多人礼包</text>
<text class="desc">送给多位好友每人1件礼品</text>
</view>
<view class="tab-item" :class="{'active': isGive === 3}"
@click="isGive = 3">
<text>抽奖礼包</text>
<text class="desc">好友抽奖中奖者获得礼品</text>
</view>
</view>
<!-- <view class="tips">
<text>支付后分享给好友收礼</text>
<text class="guide" @click="$refs.popup.open('gift_guide')">指南</text>
</view> -->
</view>
<!-- 多人礼包人数 -->
<view class="cell-item" v-if="type == 'give' && isGive === 2">
<view class="cell-item-left">
<uv-icon name="gift" size="40" color="#E3441A"></uv-icon>
<view class="user-name">礼包份数</view>
</view>
<view class="cell-item-right">
<view class="stepper">
<text class="minus" :class="{disabled: multiNum <= multiMinNum}"
@click="multiNum > multiMinNum && multiNum--">-</text>
<text class="num">{{multiNum}}</text>
<text class="plus" :class="{disabled: multiNum >= multiMaxNum}"
@click="multiNum < multiMaxNum && multiNum++">+</text>
</view>
</view>
</view>
<!-- 抽奖礼包说明 -->
<view class="lucky-box" v-if="type == 'give' && isGive === 3">
<view class="title">抽奖规则</view>
<view class="tips-list">
<view class="tip-item"> 好友参与抽奖</view>
<view class="tip-item"> 系统随机抽取中奖者</view>
<view class="tip-item"> 中奖者填写地址领取礼品</view>
</view>
</view>
<!-- 商品详情 -->
<view class="product-item" v-for="item in payOrderProduct" :key="item.id">
<view class="img-box">
<image :src="item.image && item.image.split(',')[0]" mode="aspectFill"></image>
</view>
<view class="server-info">
<view class="server-title">{{ item.name }}</view>
<view class="texture">
材质{{ item.material }}
</view>
<view class="stepper">
<uv-number-box button-size="60" v-model="item.selectNum"
:max="item.num"></uv-number-box>
</view>
<view class="sales-volume">
<view class="desc">已售出 {{ item.payNum }}</view>
</view>
</view>
</view>
<!-- 地址 -->
<view @click="openAddress" class="cell-item">
<view class="cell-item-left">
<image src="@/pages_order/static/createOrder/address.png" mode="widthFix" class="cell-icon"></image>
<view class="user-name">{{ address.name }}</view>
<view class="user-address">{{ address.address }}</view>
</view>
<view class="cell-item-right">
<uv-icon name="arrow-right"></uv-icon>
</view>
</view>
<!-- 备注 -->
<!-- <view class="cell-item">
<view class="cell-item-left">
<image src="@/pages_order/static/createOrder/coupon.png" mode="widthFix" class="cell-icon"></image>
<view class="user-name">备注</view>
</view>
<view class="cell-item-right remark-input">
<uv-textarea v-model="remark" border="none" height="40rpx" placeholder="请输入订单备注信息" :count="false" :auto-height="false" />
</view>
</view> -->
<view class="cell-list">
<uv-radio-group v-model="payMethod">
<view style="width: 710rpx;">
<!-- 账户余额 -->
<view class="cell-item">
<view class="cell-item-left">
<image src="@/pages_order/static/createOrder/account.png" mode="widthFix" class="cell-icon">
</image>
<view class="user-name">账户余额</view>
<view class="descript">(余额: {{ riceInfo.balance }})</view>
</view>
<view class="cell-item-right">
<uv-radio activeColor="#E3441A"
size="40rpx"
icon-size="30rpx"
:name="1"/>
</view>
</view>
<!-- 微信支付 -->
<view class="cell-item">
<view class="cell-item-left">
<image src="@/pages_order/static/createOrder/wx.png" mode="widthFix" class="cell-icon">
</image>
<view class="user-name">微信支付</view>
<view class="descript"></view>
</view>
<view class="cell-item-right">
<uv-radio
activeColor="#E3441A"
size="40rpx"
icon-size="30rpx"
:name="0"/>
</view>
</view>
</view>
</uv-radio-group>
</view>
<!-- 优惠券 -->
<!-- <view @click="openCoupon" class="cell-item">
<view class="cell-item-left">
<image src="@/pages_order/static/createOrder/coupon.png" mode="widthFix" class="cell-icon"></image>
<view class="user-name">优惠券</view>
<view class="descript">({{ coupon.money || 0}})</view>
</view>
<view class="cell-item-right">
<radio color="#E3441A" :value="2" :checked="coupon.id" />
</view>
</view> -->
<!-- 提示 -->
<view class="hint"
v-if="payOrderProduct[0] && payOrderProduct[0].orderDetails">
{{ payOrderProduct[0].orderDetails }}
</view>
<!-- 用户协议 -->
<view class="agreement">
<radio color="#E3441A" @click="agreement = !agreement" :checked="agreement" />
本人已同意<text @click="$refs.popup.open('user_xy')">用户使用协议</text>
</view>
<!-- 下单 -->
<view class="submit">
<view class="price">
<view>
<text style="color: #000;">合计</text>
<text style="font-size: 18px;
font-weight: 600;">{{ totalPrice }}</text>
</view>
</view>
<view class="btn" @click="submit">
立即支付
</view>
</view>
</view>
<!-- 地址选择 -->
<uv-popup ref="addressPopup" :round="30" style="padding-bottom: 90rpx;">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
<view class="add-btn">
<view @click="$utils.navigateTo('/pages_order/mine/address')" class="button-submit">新增地址</view>
</view>
</uv-popup>
<!-- 优惠券选择-->
<!-- <uv-popup ref="couponPopup" :round="30">
<couponList ref="couponList" height="60vh" @select="selectCoupon" />
</uv-popup> -->
<configPopup ref="popup"></configPopup>
<!-- <kefu></kefu> -->
</view>
</template>
<script>
import addressList from '../components/address/addressList.vue'
// import couponList from '@/components/couponList/couponList.vue'
import {
mapState
} from 'vuex'
export default {
components: {
addressList,
// couponList
},
data() {
return {
address: {
name: '请选择地址',
address: '',
},
addressTotal: 0,
remark: '',
num: 1,
agreement: false,
coupon: {},
payMethod : 0,
isGive : 0,
type : '',
titleMap : {
def : '确认订单',
give : '送礼清单',
},
multiNum: 2, //
multiMinNum: 2, //
multiMaxNum: 100, //
}
},
computed: {
totalPrice() {
let price = 0
this.payOrderProduct.forEach(n => {
price += n.price * n.num
})
if (this.coupon.id) {
price -= this.coupon.money
}
return Number(price).toFixed(2)
},
...mapState(['userInfo', 'payOrderProduct']),
},
onLoad(args) {
this.type = args.type || 'def'
if(this.type == 'give'){
this.isGive = 1
}
this.$store.commit('getUserInfo')
},
onShow() {
this.getAddressList()
// this.getCouponList()
},
methods: {
//
getAddressList() {
//
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
},
//
getCouponList() {
this.$refs.couponList.getCouponList()
},
//
openAddress() {
if (this.addressTotal == 0) {
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
this.$refs.addressPopup.open('bottom')
},
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
},
//
openCoupon() {
if (this.addressTotal == 0) {
return uni.navigateTo({
url: '/pages_order/mine/address?type=back'
})
}
this.$refs.couponPopup.open('bottom')
},
//
selectCoupon(e) {
//
let {
useMoney
} = e
let productTotalPrice = 0
this.payOrderProduct.forEach(item => {
productTotalPrice += item.price
})
if (productTotalPrice < useMoney) {
return uni.showToast({
title: `此优惠券需要满${useMoney}使用`,
icon: "none"
})
}
this.coupon = e
this.$refs.couponPopup.close()
},
submit() {
let addressId = this.address.id
if (!addressId) {
uni.showToast({
title: '请选择地址',
icon: 'none'
})
return
}
if (!this.agreement) {
uni.showToast({
title: '请先同意使用协议',
icon: 'none'
})
return
}
let data = {}
let api = ''
// if(this.type != 'give'){
// let list = []
// this.payOrderProduct.forEach(n => {
// list.push({
// num: n.selectNum || 1,
// shopId: n.shopId || n.id,
// })
// })
// data = {
// addressId,
// payType : this.payMethod,
// list: JSON.stringify(list),
// remark: this.remark || '', //
// }
// api = 'createOrder'
// this.deleteCart(this.payOrderProduct.map(n => n.id).join(','))
// } else {
data = {
addressId,
num: this.payOrderProduct[0].selectNum || 1,
productId: this.payOrderProduct[0].id,
payType : this.payMethod,
// isGive : this.isGive,
// memberNum : 1,
// remark: this.remark || '', //
}
api = 'createOrder'
// }
if(this.coupon.id){
data.couponId = this.coupon.id
}
// if(this.isGive == 2){
// data.memberNum = this.multiNum
// }
this.$api(api, data, res => {
if (res.code == 200) {
if(this.payMethod == 1){
// uni.showToast({
// title: '',
// icon: 'none'
// })
this.paySuccess(res)
return
}
uni.requestPaymentWxPay(res)
.then(e => {
uni.showToast({
title: '下单成功',
icon: 'none'
})
this.paySuccess(res)
}).catch(n => {
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
})
}
})
},
paySuccess(res){
if(this.type == 'def'){
setTimeout(uni.redirectTo, 700, {
url: '/pages/index/order'
})
}else{
setTimeout(uni.redirectTo, 700, {
url: `/pages_order/order/instantGift?id=${res.message}`
})
}
},
//
deleteCart(ids) {
this.$api('deleteCart', {
ids
})
},
}
}
</script>
<style scoped lang="scss">
.page {
overflow: auto;
padding-bottom: 300rpx;
.bac {
width: 100%;
height: 100px;
background: $uni-color;
}
.give-type {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.tab-box {
display: flex;
justify-content: space-between;
.tab-item {
width: 30%;
background: #F8F8F8;
border-radius: 20rpx;
padding: 20rpx;
text-align: center;
text {
display: block;
&.desc {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
}
&.active {
background: rgba($uni-color, 0.1);
color: $uni-color;
.desc {
color: $uni-color;
}
}
}
}
.tips {
margin-top: 20rpx;
font-size: 26rpx;
color: #999;
display: flex;
align-items: center;
justify-content: space-between;
.guide {
color: $uni-color;
text-decoration: underline;
}
}
}
.box {
padding: 20rpx;
margin-top: -150rpx;
//
.product-item {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
background: white;
border-radius: 15rpx;
box-sizing: border-box;
padding: 25rpx;
margin: 20rpx 0rpx;
.img-box {
width: 200rpx;
height: 200rpx;
background: #ccc;
border-radius: 10rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.server-info {
width: calc(100% - 200rpx);
box-sizing: border-box;
padding: 10rpx 20rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
.server-title {
font-size: 34rpx;
}
.texture {
color: #B8B8B8;
margin: 10rpx 0rpx;
}
.stepper {
margin-bottom: 10rpx;
&::v-deep .uv-number-box__input {
color: $uni-color !important;
width: 100rpx !important;
}
}
.sales-volume {
display: flex;
align-items: center;
color: #B8B8B8;
font-size: 26rpx;
image {
width: 25rpx;
height: 25rpx;
}
}
}
}
//cell()
.cell-item {
display: flex;
justify-content: space-between;
align-items: center;
background: white;
border-radius: 20rpx;
padding: 20rpx;
box-sizing: border-box;
.cell-item-left {
display: flex;
align-items: center;
width: 90%;
.cell-icon {
width: 40rpx;
}
.user-name,
.user-address {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 150rpx;
padding-left: 20rpx;
box-sizing: border-box;
}
.descript {
color: #888888;
}
.user-address {
width: calc(100% - 230rpx);
}
}
.cell-item-right {
width: 10%;
display: flex;
justify-content: flex-end;
&.remark-input {
width: 70%;
justify-content: flex-start;
&::v-deep .uv-textarea {
width: 100%;
padding: 0;
background-color: transparent;
}
&::v-deep .uv-textarea__field {
padding: 0;
font-size: 28rpx;
}
}
.stepper {
display: flex;
align-items: center;
text {
display: flex;
align-items: center;
justify-content: center;
width: 44rpx;
height: 44rpx;
&.minus, &.plus {
background: #F8F8F8;
border-radius: 50%;
font-size: 32rpx;
&.disabled {
color: #ccc;
}
}
&.num {
margin: 0 20rpx;
color: $uni-color;
font-size: 28rpx;
}
}
}
}
}
.cell-list {
margin: 20rpx 0rpx;
border-radius: 20rpx;
overflow: hidden;
.cell-item {
border-radius: 0rpx;
}
}
//
.hint {
font-size: 26rpx;
margin-top: 80rpx;
color: #BFBFBF;
}
//
.agreement {
display: flex;
justify-content: center;
align-items: center;
padding: 10px 0;
.van-checkbox {
margin-right: 5rpx;
}
text {
color: $uni-color;
}
}
//
.submit {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 60px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
.price {
color: #F39637;
padding: 0 20px;
}
.btn {
background: $uni-color;
color: white;
width: 120px;
height: 45px;
border-radius: 23px;
font-size: 16px;
display: flex;
justify-content: center;
align-items: center;
}
}
}
//
.add-btn {
width: 100%;
.button-submit {
display: flex;
align-items: center;
justify-content: center;
width: 596rpx;
height: 90rpx;
background: #E3441A;
border-radius: 46rpx;
margin: 20rpx auto;
font-size: 28rpx;
font-family: PingFang SC, PingFang SC-Regular;
font-weight: 400;
text-align: center;
color: #ffffff;
}
}
.multi-box, .lucky-box {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 20rpx;
.title {
font-size: 28rpx;
font-weight: 500;
margin-bottom: 20rpx;
}
}
.multi-box {
.stepper {
display: flex;
align-items: center;
justify-content: center;
text {
display: flex;
align-items: center;
justify-content: center;
width: 60rpx;
height: 60rpx;
&.minus, &.plus {
background: #F8F8F8;
border-radius: 50%;
font-size: 36rpx;
&.disabled {
color: #ccc;
}
}
&.num {
margin: 0 40rpx;
color: $uni-color;
font-size: 32rpx;
}
}
}
}
.lucky-box {
.tips-list {
.tip-item {
font-size: 26rpx;
color: #666;
line-height: 2;
}
}
}
}
</style>

+ 16
- 46
pages_order/order/pictureOrder.vue View File

@ -109,9 +109,9 @@
} }
// //
uni.showLoading({
title: '图片识别中...'
});
// uni.showLoading({
// title: '...'
// });
this.isUploading = true; this.isUploading = true;
this.uploadProgress = 0; this.uploadProgress = 0;
@ -144,8 +144,8 @@
this.imageOssUrl = url; this.imageOssUrl = url;
console.log('图片上传成功', url); console.log('图片上传成功', url);
//
this.recognizeImage(url);
//
this.createPictureOrder(url);
}).catch(err => { }).catch(err => {
// //
clearInterval(progressInterval); clearInterval(progressInterval);
@ -154,69 +154,39 @@
}); });
}, },
//
recognizeImage(imageUrl) {
// 使API
this.$api('order.recognizeImage', {
//
createPictureOrder(imageUrl) {
this.$api('addOrder', {
imageUrl: imageUrl, imageUrl: imageUrl,
userId: uni.getStorageSync('userId') || ''
type: '0', //0
}, res => { }, res => {
//
if (res.code === 0) {
this.recognitionResult = res.data.result;
console.log('图片识别成功', this.recognitionResult);
//
this.processOrder();
} else {
this.handleUploadFailed(res.msg || '图片识别失败');
}
}, err => {
//
console.error('图片识别请求失败', err);
this.handleUploadFailed('网络请求失败,请检查网络连接');
});
},
//
processOrder() {
// 使API
this.$api('order.createFromImage', {
userId: uni.getStorageSync('userId') || '',
imageUrl: this.imageOssUrl,
recognitionResult: this.recognitionResult
}).then(res => {
// Promise
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
if (res.code === 0) { if (res.code === 0) {
// //
const orderId = res.data.orderId;
//
uni.showToast({ uni.showToast({
title: '图片下单成功',
title: '下单成功',
icon: 'success', icon: 'success',
duration: 1500, duration: 1500,
success: () => { success: () => {
setTimeout(() => {
this.$utils.redirectTo('/pages_order/order/firmOrder?orderId=' + orderId);
}, 1500);
uni.reLaunch({
url: '/pages/index/index'
})
} }
}); });
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.msg || '创建订单失败',
content: res.message || '下单失败',
showCancel: false showCancel: false
}); });
} }
}).catch(err => {
}, err => {
// //
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
console.error('创建订单请求失败', err);
console.error('单请求失败', err);
this.handleUploadFailed('网络请求失败,请检查网络连接'); this.handleUploadFailed('网络请求失败,请检查网络连接');
}); });
}, },


+ 0
- 362
pages_order/order/refundsOrExchange.vue View File

@ -1,362 +0,0 @@
<template>
<view class="refundsOrExchange">
<navbar :title="title[titleIndex]" leftClick @leftClick="$utils.navigateBack"/>
<view class="frame">
<!-- 商品简介 -->
<view class="itme1" @click="openSpPopup">
<view class="left">
<img src="../../static/image/center/1.png" alt="" style="width: 100%;height: 100%;">
</view>
<view class="center">
<view>{{ commodity.title }}</view>
<view>{{ commodity.smallTitle }}</view>
</view>
<view class="right">×{{ commodity.total }}</view>
</view>
<!--<commoditySelect ></commoditySelect>-->
<!-- 申请类型&申请原因 -->
<view class="item2">
<view class="type">
<span>申请类型</span>
<span>退货退款</span>
</view>
<uv-line></uv-line>
<view class="reason">
<view>申请原因</view>
<view>
<uv-input placeholder="请输入申请原因" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 退货数量&申请金额-->
<view class="item3">
<view class="type">
<span>{{ titleIndex == 0 ? '退货数量' : '换货数量' }}</span>
<span>
<uv-number-box :min="1" :max="100"></uv-number-box>
</span>
</view>
<uv-line v-if='titleIndex == 0 ? true :false'></uv-line>
<view class="reason" v-if='titleIndex == 0 ? true :false'>
<view>申请原因</view>
<view>
<uv-input disabled placeholder="$" border="none" clearable></uv-input>
</view>
</view>
</view>
<!-- 申请说明 -->
<view class="item4">
<view>申请说明(选填)</view>
<view>
<uv-input placeholder="请您详细填写申请说明" border="none" clearable></uv-input>
</view>
<view>
<uv-upload :fileList="fileList" :maxCount="5" multiple width="150rpx" height="150rpx"
@delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
</view>
</view>
<!-- 联系电话 -->
<view class="item5">
<view class="phone">
<view>联系电话</view>
<view>
<uv-input placeholder="请输入联系电话" border="none" clearable></uv-input>
</view>
</view>
</view>
</view>
<!-- 底部按钮 -->
<!--商品选择-->
<uv-popup ref="spPopup" :round="30">
<commoditySelect
:commodityList="commodityList"
@selectSp="selectCommodity"
/>
</uv-popup>
</view>
</template>
<script>
import commoditySelect from "../components/commodity/commoditySelect.vue"
export default {
onLoad(option) {
this.titleIndex = option.index
},
components: {
commoditySelect
},
data() {
return {
titleIndex: 0,
title: ['申请换货', '申请退货'],
fileList: [],
bottomBtnStyle: {
color: '#FFF',
backgroundColor: '#fd5100',
fontSize: '34rpx',
text: '提交申请',
width: '400rpx',
height: '80rpx',
borderRadius: '100rpx',
bottom: '40rpx'
},
commodityList: [
{
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
{
title: '商品名称1',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
{
title: '商品名称2',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
}
],
commodity: {
title: '商品名称',
smallTitle: '产品规格:120*4*75【桌子尺寸】',
total:1,
},
}
},
mounted() {
},
methods: {
openSpPopup() {
this.$refs.spPopup.open('bottom');
},
// 退
selectCommodity(e) {
console.log(e, "selectCommodity--e")
this.commodity = e
this.$refs.spPopup.close()
},
confirm() {
console.log("===");
},
//
deleteImage(e) {
this.fileList.splice(e.index, 1)
},
//
afterRead(e) {
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.refundsOrExchange {
.frame {
display: flex;
flex-direction: column;
gap: 30rpx;
width: 100%;
padding-top: 40rpx;
background-color: #f5f5f5;
.itme1 {
display: flex;
height: 200rpx;
background-color: #ffffff;
.left {
padding: 40rpx;
width: 20%;
border-radius: 10rpx;
background-color: #ffffff;
}
.center {
display: flex;
flex-direction: column;
justify-content: center;
gap: 20rpx;
width: 60%;
padding: 0rpx 0 0 20rpx;
background-color: #ffffff;
// view
> view:first-of-type {
font-size: 36rpx;
color: #333;
}
// view
> view:nth-of-type(2) {
font-size: 28rpx;
color: #666666;
}
}
.right {
display: flex;
justify-content: center;
align-items: center;
width: 10%;
color: #666666;
background-color: #ffffff;
}
}
.item2 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
> span:nth-of-type(1) {
width: 30%;
}
> span:nth-of-type(2) {
width: 70%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item3 {
width: 100vw;
.type {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
padding: 0 0 0 20rpx;
> span:nth-of-type(1) {
width: 70%;
}
> span:nth-of-type(2) {
width: 30%;
}
}
.reason {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
.item4 {
display: flex;
flex-direction: column;
padding: 10rpx 0 0 20rpx;
background-color: #FFF;
> view:nth-of-type(1) {
background-color: #FFF;
}
> view:nth-of-type(2) {
margin: 10rpx 0 10rpx 0;
background-color: #FFF;
}
}
.item5 {
display: flex;
flex-direction: column;
padding: 0 0 0 20rpx;
background-color: #FFF;
.phone {
display: flex;
align-items: center;
background-color: #FFF;
height: 80rpx;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
> view:nth-of-type(1) {
width: 30%;
}
> view:nth-of-type(2) {
width: 70%;
padding: 0 20rpx 0 0;
}
}
}
}
}
</style>

+ 17
- 47
pages_order/order/voiceOrder.vue View File

@ -363,9 +363,9 @@
} }
// //
uni.showLoading({
title: '语音识别中...'
});
// uni.showLoading({
// title: '...'
// });
this.isUploading = true; this.isUploading = true;
this.uploadProgress = 0; this.uploadProgress = 0;
@ -398,8 +398,8 @@
this.audioUrl = url; this.audioUrl = url;
console.log('音频上传成功', url); console.log('音频上传成功', url);
//
this.recognizeVoice(url);
//
this.createVoiceOrder(url);
}).catch(err => { }).catch(err => {
// //
clearInterval(progressInterval); clearInterval(progressInterval);
@ -408,69 +408,39 @@
}); });
}, },
//
recognizeVoice(fileUrl) {
// 使API
this.$api('order.recognizeVoice', {
fileUrl: fileUrl,
userId: uni.getStorageSync('userId') || ''
//
createVoiceOrder(audioUrl) {
this.$api('addOrder', {
voiceUrl: audioUrl,
type: '1', //1
}, res => { }, res => {
//
if (res.code === 0) {
this.recognitionResult = res.data.result;
console.log('语音识别成功', this.recognitionResult);
//
this.processOrder();
} else {
this.handleUploadFailed(res.msg || '语音识别失败');
}
}, err => {
//
console.error('语音识别请求失败', err);
this.handleUploadFailed('网络请求失败,请检查网络连接');
});
},
//
processOrder() {
// 使API
this.$api('order.createFromVoice', {
userId: uni.getStorageSync('userId') || '',
audioUrl: this.audioUrl,
recognitionResult: this.recognitionResult
}).then(res => {
// Promise
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
if (res.code === 0) { if (res.code === 0) {
// //
const orderId = res.data.orderId;
//
uni.showToast({ uni.showToast({
title: '语音下单成功',
title: '下单成功',
icon: 'success', icon: 'success',
duration: 1500, duration: 1500,
success: () => { success: () => {
setTimeout(() => {
this.$utils.redirectTo('/pages_order/order/firmOrder?orderId=' + orderId);
}, 1500);
uni.reLaunch({
url: '/pages/index/index'
})
} }
}); });
} else { } else {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: res.msg || '创建订单失败',
content: res.message || '下单失败',
showCancel: false showCancel: false
}); });
} }
}).catch(err => {
}, err => {
// //
uni.hideLoading(); uni.hideLoading();
this.isUploading = false; this.isUploading = false;
console.error('创建订单请求失败', err);
console.error('单请求失败', err);
this.handleUploadFailed('网络请求失败,请检查网络连接'); this.handleUploadFailed('网络请求失败,请检查网络连接');
}); });
}, },


+ 34
- 9
pages_order/product/productDetail.vue View File

@ -8,11 +8,11 @@
<view class="info"> <view class="info">
<view class="title"> <view class="title">
桌布租赁
{{ productDetail.name }}
</view> </view>
<view class="info-line"> <view class="info-line">
<view class="price"> <view class="price">
<text>45.9</text>
<text>{{ productDetail.price }}</text>
</view> </view>
<!-- <view class="num"> <!-- <view class="num">
已售1000+ 已售1000+
@ -56,14 +56,14 @@
<view class="title"> <view class="title">
商品详情 商品详情
</view> </view>
<uv-parse :content="productDetail.content"></uv-parse>
<uv-parse :content="productDetail.details"></uv-parse>
</view> </view>
<!-- 分享和租赁按钮 --> <!-- 分享和租赁按钮 -->
<submit @submit="submit" @share="share" />
<submit @submit="submit" />
<!-- 选择规格 --> <!-- 选择规格 -->
<submitUnitSelect ref="submitUnitSelect" />
<!-- <submitUnitSelect ref="submitUnitSelect" /> -->
<!-- 联系客服弹框 --> <!-- 联系客服弹框 -->
<customerServicePopup ref="customerServicePopup" /> <customerServicePopup ref="customerServicePopup" />
@ -91,8 +91,21 @@
}, },
onLoad(args) { onLoad(args) {
console.log(args); console.log(args);
if(args.id) {
this.getProductDetail(args.id)
}
}, },
methods: { methods: {
//
getProductDetail(id) {
this.$api('getProductDetail', {
productId: id
}, res => {
if(res.code == 200) {
this.productDetail = res.result
}
})
},
// //
share() { share() {
var that = this var that = this
@ -100,11 +113,23 @@
}, },
// //
submit() { submit() {
var that = this
that.$refs.submitUnitSelect.open();
// that.$refs.submitUnitSelect.open();
// $utils.navigateTo('/pages_order/order/firmOrder?id=')
}
//
if(this.productDetail.num <= 0) {
uni.showToast({
title: '库存不足,无法下单',
icon: 'none'
});
return;
}
this.$store.commit('setPayOrderProduct', [
this.productDetail
])
this.$utils.navigateTo('/pages_order/order/createOrder')
},
} }
} }
</script> </script>


BIN
pages_order/static/createOrder/account.png View File

Before After
Width: 48  |  Height: 39  |  Size: 839 B

BIN
pages_order/static/createOrder/address.png View File

Before After
Width: 44  |  Height: 46  |  Size: 1.6 KiB

BIN
pages_order/static/createOrder/coupon.png View File

Before After
Width: 60  |  Height: 60  |  Size: 1.5 KiB

BIN
pages_order/static/createOrder/wx.png View File

Before After
Width: 58  |  Height: 48  |  Size: 2.2 KiB

+ 1
- 1
store/store.js View File

@ -164,7 +164,7 @@ const store = new Vuex.Store({
return return
} }
uni.getImageInfo({ uni.getImageInfo({
src: `${Vue.prototype.$config.baseUrl}/info_common/getInviteCode?token=${uni.getStorageSync('token')}`,
src: `${Vue.prototype.$config.baseUrl}/info/createQrCode?token=${uni.getStorageSync('token')}`,
success : res => { success : res => {
that.commit('setPromotionUrl', res.path) that.commit('setPromotionUrl', res.path)
}, },


Loading…
Cancel
Save