Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
3c3d34787b
23 changed files with 589 additions and 44 deletions
  1. +7
    -1
      App.vue
  2. +2
    -1
      api/http.js
  3. +8
    -0
      api/model/index.js
  4. +16
    -0
      api/model/info.js
  5. +16
    -0
      mixins/order.js
  6. +3
    -0
      pages.json
  7. +1
    -1
      pages/index/cart.vue
  8. +30
    -1
      pages/index/category.vue
  9. +17
    -1
      pages/index/center.vue
  10. +36
    -9
      pages/index/index.vue
  11. +27
    -1
      pages/index/member.vue
  12. +6
    -6
      pages/index/order.vue
  13. +5
    -1
      pages_order/components/address/redactAddress.vue
  14. +351
    -0
      pages_order/home/addEnterprise.vue
  15. +5
    -3
      pages_order/home/contact.vue
  16. +12
    -4
      pages_order/mine/balance.vue
  17. +1
    -0
      pages_order/mine/recharge.vue
  18. +13
    -4
      pages_order/mine/withdraw.vue
  19. +25
    -3
      pages_order/order/createOrder.vue
  20. BIN
      static/image/home/logo.png
  21. +3
    -3
      uni_modules/uv-cell/components/uv-cell/uv-cell.vue
  22. +2
    -2
      uni_modules/uv-number-box/components/uv-number-box/props.js
  23. +3
    -3
      uni_modules/uv-number-box/components/uv-number-box/uv-number-box.vue

+ 7
- 1
App.vue View File

@ -11,7 +11,7 @@
}
</script>
<style>
<style lang="scss">
@import url("common.scss");
/*每个页面公共css */
body{
@ -21,4 +21,10 @@
.page{
padding-top: var(--window-top);
}
.redact-address {
.uv-input__content__field-wrapper__field{
padding: 10rpx !important;
}
}
</style>

+ 2
- 1
api/http.js View File

@ -33,7 +33,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
utils.toLogin()
}
if(res.statusCode == 200 && res.data.code != 200){
if(res.statusCode == 200 && res.data.code != 200
&& res.data.code != 902){
uni.showToast({
mask: true,
duration: 1000,


+ 8
- 0
api/model/index.js View File

@ -106,6 +106,14 @@ const api = {
limit : 1000,
showLoading : true,
},
// 确认收货
confirmOrder: {
url: '/rice_index/confirmOrder',
method: 'GET',
auth : true,
limit : 1000,
showLoading : true,
},
}
export default api

+ 16
- 0
api/model/info.js View File

@ -103,6 +103,22 @@ const api = {
url: '/rice_info/getCartPageList',
method: 'GET',
},
// 增加或者修改渠道申请信息
addOrUpdateCommonUser: {
url: '/rice_info/addOrUpdateCommonUser',
method: 'POST',
limit : 500,
auth : true,
showLoading : true,
},
// 查询渠道申请信息
getCommonUser: {
url: '/rice_info/getCommonUser',
method: 'GET',
limit : 500,
auth : true,
showLoading : true,
},
}
export default api

+ 16
- 0
mixins/order.js View File

@ -8,6 +8,7 @@ export default {
computed: {
},
methods: {
// 立即支付
toPayOrder(item){
let api = ''
@ -35,5 +36,20 @@ export default {
}
})
},
// 确认收货
confirmOrder(item){
uni.showModal({
title: '您收到货了吗?',
success : e => {
if(e.confirm){
this.$api('confirmOrder', {
orderId : item.id,
}, res => {
this.getData()
})
}
}
})
},
}
}

+ 3
- 0
pages.json View File

@ -114,6 +114,9 @@
},
{
"path": "home/contact"
},
{
"path": "home/addEnterprise"
}
]
}],


+ 1
- 1
pages/index/cart.vue View File

@ -167,7 +167,7 @@
},
deleteCart(e, item){
this.$api('deleteCart', {
id : item.id
ids : item.id
}, res => {
this.getData()
})


+ 30
- 1
pages/index/category.vue View File

@ -2,6 +2,15 @@
<view class="page">
<navbar title="商品列表" leftClick @leftClick="$utils.navigateBack" />
<view class="search">
<uv-search
placeholder="搜你喜欢的产品"
bgColor="#fff"
@search="getData"
@custom="getData"
v-model="queryParams.title"></uv-search>
</view>
<view class="category">
<uv-vtabs
:list="category"
@ -41,7 +50,10 @@
computed: {
...mapState(['category'])
},
onLoad() {
onLoad({search}) {
if(search){
this.queryParams.title = search
}
this.$store.commit('getCategoryList')
if(this.category.length > 0){
this.queryParams.classId = this.category[0].id
@ -67,6 +79,23 @@
/deep/ .uv-vtabs__content{
height: calc(100vh - 220rpx) !important;
}
.search {
position: relative;
background: #FFFFFF;
margin: 20rpx;
border-radius: 41rpx;
padding: 10rpx 20rpx;
display: flex;
align-items: center;
/deep/ .uv-search__action {
background-color: $uni-color;
color: #FFFFFF;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
}
}
.category {
font-size: 30rpx;


+ 17
- 1
pages/index/center.vue View File

@ -53,6 +53,16 @@
<view class="boxs"
@click="$utils.navigateTo('/pages_order/mine/recharge')">去充值</view>
</view> -->
<view class="box"
@click="clickNo">
<view>
<view class="num">{{ riceInfo.balance || 0 }}</view>
<view class="text">余额()</view>
</view>
<view class="boxs"
>去充值</view>
</view>
<view class="box">
<view
@ -167,7 +177,13 @@
this.$store.commit('getUserInfo')
this.$store.commit('getRiceInfo')
},
methods: {}
methods: {
clickNo(){
uni.showModal({
title: '暂未开放',
})
},
}
}
</script>


+ 36
- 9
pages/index/index.vue View File

@ -6,15 +6,20 @@
<view class="bg-color"></view>
<view class="page-title">
{{ configList.index_title }}
<!-- {{ configList.index_title }} -->
<image src="/static/image/home/logo.png"
style="width: 240rpx;"
mode="widthFix"></image>
</view>
<!-- <view class="search">
<view class="search">
<uv-search
placeholder="搜你喜欢的产品"
bgColor="#fff"
@custom="search"
@search="search"
v-model="keyword"></uv-search>
</view> -->
</view>
<view class="swipe">
<uv-swiper
@ -90,8 +95,8 @@
<view class="box-text">
<view>{{ item.title }}</view>
<view>{{ item.sku }}</view>
<text class="text1">{{ item.price }}</text>
<text class="text2">原价{{ item.oldPrice }}</text>
<view class="text3">会员价 <text>{{ item.vipPrice }}</text> </view>
<view class="text4">零售价{{ item.price }}</view>
</view>
<view class="box-img">
<image :src="item.image &&
@ -235,6 +240,13 @@
this.getRiceNewsList()
},
methods: {
//
search(){
uni.navigateTo({
url: '/pages/index/category?search=' + this.keyword
})
this.keyword = ''
},
//
getBanner(){
this.$api('getRiceBanner', res => {
@ -342,7 +354,7 @@
.page-title {
position: relative;
margin-left: 30rpx;
margin-bottom: 30rpx;
// margin-bottom: 30rpx;
font-size: 34rpx;
font-weight: 900;
}
@ -535,13 +547,28 @@
}
.text1 {
color: red;
font-size: 68rpx;
color: #f40;
font-size: 58rpx;
}
.text2 {
font-size: 28rpx;
color: #CCCCCC;
color: #999;
}
.text3 {
color: #f40;
font-size: 28rpx;
text{
font-size: 30rpx;
font-weight: 900;
}
}
.text4 {
font-size: 26rpx;
color: #999;
}
}


+ 27
- 1
pages/index/member.vue View File

@ -1,6 +1,9 @@
<template>
<view class="page">
<navbar title="会员" />
<navbar title="会员"
:leftClick="leftClick"
@leftClick="$utils.navigateBack"
/>
<view class="swipe">
<uv-swiper
@ -24,7 +27,16 @@
<view class="pad">
{{ riceInfo.memberNum }}/{{ configList.vip_open_num }}
</view>
<view class="tips-click"
v-if="userInfo.isPay">
已成为会员
<text
@click="$utils.navigateTo('/pages/index/category')">去购买</text>
</view>
<view class="submitOpen"
v-else
@click="submitOpen">
开通会员
</view>
@ -153,15 +165,23 @@
return {
bannerList: [],
vipInfoList: [],
leftClick : false,
};
},
computed : {
...mapState(['userInfo', 'riceInfo']),
},
onLoad({leftClick}) {
this.leftClick = leftClick
},
onShow() {
this.getBanner()
this.getRiceVipList()
this.$store.commit('getRiceInfo')
if(uni.getStorageSync('token')){
this.$store.commit('getUserInfo')
}
},
methods : {
//
@ -254,6 +274,12 @@
font-size: 26rpx;
}
}
.tips-click{
font-size: 26rpx;
text{
color: #A3D250;
}
}
}
.middle {


+ 6
- 6
pages/index/order.vue View File

@ -73,11 +73,11 @@
立即付款
</view>
<!-- <view class="b2"
@click.stop=""
v-if="item.state == 3">
立即评价
</view> -->
<view class="b2"
@click.stop="confirmOrder(item)"
v-if="item.state == 2">
确认收货
</view>
</view>
</view>
@ -225,7 +225,7 @@
view {
margin: 12rpx;
border-radius: 28rpx;
padding: 8rpx 28rpx;
padding: 16rpx 48rpx;
margin-bottom: 0;
}
}


+ 5
- 1
pages_order/components/address/redactAddress.vue View File

@ -175,6 +175,11 @@
.uv-form {
padding: 30rpx 0rpx;
}
.uv-input__content__field-wrapper__field{
padding: 30rpx !important;
height: 180rpx !important;
}
&::v-deep .uv-cell {
padding: 0rpx 0rpx;
@ -188,7 +193,6 @@
display: flex;
align-items: center;
height: 80rpx;
}
.uv-field__control,


+ 351
- 0
pages_order/home/addEnterprise.vue View File

@ -0,0 +1,351 @@
<template>
<view class="applyLaundryStore">
<navbar title="渠道合作" leftClick @leftClick="$utils.navigateBack" />
<view class="frame">
<view class="title">
<span
style="width: 10rpx;height: 40rpx;background-color: #f78142;border-radius: 10rpx;overflow: hidden;"></span>
<span>申请信息</span>
</view>
<view class="shopName">
<view>类型</view>
<view>
<uv-radio-group v-model="form.type">
<uv-radio
v-for="(item, index) in typeList"
:key="index"
:customStyle="{margin: '16rpx'}"
size="40rpx"
iconSize="30rpx"
labelSize="30rpx"
:disabled="isUpdate"
:label="item.name"
:name="item.type">
</uv-radio>
</uv-radio-group>
</view>
</view>
<view class="shopName">
<view style="width: 300rpx;"
v-if="form.type">身份证</view>
<view style="width: 300rpx;"
v-else>营业执照</view>
<view>
<uv-upload
:fileList="fileList"
name="fileList"
:maxCount="2"
width="180rpx"
height="180rpx"
:disabled="isUpdate"
multiple
@afterRead="afterRead"
@delete="deleteImage">
</uv-upload>
</view>
</view>
<view class="shopName">
<view>姓名</view>
<view>
<input v-model="form.name"
:disabled="isUpdate" placeholder="请输入姓名" clearable></input>
</view>
</view>
<view class="shopName">
<view>性别</view>
<view>
<uv-radio-group v-model="form.sex">
<uv-radio
v-for="(item, index) in sexList"
:key="index"
:customStyle="{margin: '16rpx'}"
size="40rpx"
iconSize="30rpx"
:disabled="isUpdate"
labelSize="30rpx"
:label="item.name"
:name="item.name">
</uv-radio>
</uv-radio-group>
</view>
</view>
<view class="shopName">
<view>手机号</view>
<view>
<input v-model="form.phone"
:disabled="isUpdate" type="number" placeholder="请输入手机号" clearable></input>
</view>
</view>
<view class="shopName" v-if="form.type">
<view>身份证号</view>
<view>
<input v-model="form.no"
:disabled="isUpdate" placeholder="请输入身份证号" clearable></input>
</view>
</view>
<view class="shopName" v-else>
<view>社会信用代码</view>
<view>
<input v-model="form.no"
:disabled="isUpdate" placeholder="请输入社会信用统一代码" clearable></input>
</view>
</view>
<view class="shopName">
<view>邮寄地址</view>
<view>
<input v-model="form.address"
:disabled="isUpdate" placeholder="请输入邮寄地址" clearable></input>
</view>
</view>
</view>
<view class="config">
<uv-checkbox-group
v-model="checkboxValue"
shape="circle">
<view class="content">
<view
style="display: flex;">
<uv-checkbox
size="40rpx"
icon-size="30rpx"
activeColor="#A3D250"
:name="1"
></uv-checkbox>
阅读并同意我们的<text @click="$refs.popup.open('shop_user_xy')">合作协议</text>
</view>
</view>
</uv-checkbox-group>
</view>
<!-- 底部按钮 -->
<view class="uni-color-btn"
@click="submitApplication"
v-if="!isUpdate">
提交
</view>
<configPopup ref="popup"></configPopup>
</view>
</template>
<script>
import Position from '@/utils/position.js'
export default {
components: {
},
data() {
return {
checkboxValue : [],
form: {
userName: '',
name: '',
phone: '',
sex : '男',
type : 0,
state : 0,
},
fileList: [],
sexList : [
{
name: '男',
},
{
name: '女',
},
],
typeList : [
{
name: '企业',
type : 0,
},
{
name: '个人',
type : 1,
},
],
}
},
computed: {
isUpdate(){
return this.form.state == 1
},
},
onShow() {
},
onLoad() {
this.getData()
},
methods: {
deleteImage(e){
this[e.name].splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self[e.name].push({
url
})
})
})
},
//
submitApplication() {
if(!this.checkboxValue.length){
return uni.showToast({
title: '请先同意合作协议',
icon:'none'
})
}
this.form.image = this.fileList.map((item) => item.url).join(",")
let p = {
image: '请上传店铺照片',
name: '请输入您的姓名',
phone: '请输入联系电话',
no: '请输入社会信用代码',
address: '请输入邮寄地址',
}
if(this.form.type){
p.no = '请输入身份证号'
}
if (this.$utils.verificationAll(this.form, p)) {
return
}
if(!this.$utils.verificationPhone(this.form.phone)){
return uni.showToast({
title: '手机号格式不正确',
icon:'none'
})
}
this.$api('addOrUpdateCommonUser', this.form, res => {
if (res.code == 200) {
uni.showToast({
title: '申请成功待审核', //
icon: 'success', // 'success', 'loading', 'none'
duration: 1500 // 1500
});
setTimeout(uni.navigateBack, 1000, -1)
}
})
},
getData(){
this.$api('getCommonUser', res => {
if(res.code == 200){
this.form = res.result
delete this.form.userId
delete this.form.createTime
delete this.form.createBy
delete this.form.state
delete this.form.updateBy
delete this.form.updateTime
res.result.image && res.result.image.split(',')
.forEach(url => {
this.fileList.push({
url
})
})
}
})
},
}
}
</script>
<style lang="scss" scoped>
* {
box-sizing: border-box;
}
.applyLaundryStore {
padding: 0 20rpx 0 20rpx;
background-color: #f5f5f5;
.frame {
display: flex;
flex-direction: column;
gap: 20rpx;
background-color: #FFF;
margin-top: 20rpx;
padding: 20rpx;
.title {
display: flex;
// padding-top: 40rpx;
font-size: 34rpx;
font-weight: 700;
padding: 0 0 0 20rpx;
>span:nth-of-type(1) {
margin: 4rpx 0 0 8rpx;
background-color: #FFF;
}
>span:nth-of-type(2) {
margin: 0 0 0 8rpx;
background-color: #FFF;
}
}
.shopName {
display: flex;
align-items: center;
background-color: #FFF;
// margin: 10rpx 0 0 0;
padding: 10rpx 0 0 20rpx;
>view:nth-of-type(1) {
width: 30%;
// font-weight: 700;
}
>view:nth-of-type(2) {
width: 70%;
// padding: 0 20rpx 0 0;
border-radius: 10rpx;
overflow: hidden;
input {
background-color: #f5f5f5;
// color: #a4a4a4;
font-size: 28rpx;
padding: 8rpx 8rpx 8rpx 15rpx;
}
}
}
}
.config{
font-size: 26rpx;
padding: 20rpx;
/deep/ .uv-checkbox-group{
display: flex;
justify-content: center;
}
text{
color: $uni-color;
}
}
}
</style>

+ 5
- 3
pages_order/home/contact.vue View File

@ -3,7 +3,8 @@
<navbar title="联系我们" leftClick @leftClick="$utils.navigateBack" />
<view class="box">
<view class="">
<view class=""
v-if="configList.wx_image">
<image :src="configList.wx_image" mode="aspectFill"></image>
<view class="uni-color-btn"
@click="saveImage(configList.wx_image)">
@ -11,8 +12,9 @@
</view>
</view>
<view class="">
联系电话{{ configList.phone }}
<view class=""
v-if="configList.phone">
全国联系电话{{ configList.phone }}
<view class="uni-color-btn"
@click="confirm">
拨打电话


+ 12
- 4
pages_order/mine/balance.vue View File

@ -29,8 +29,14 @@
:center="true">
<template #value>
<view class="cell-text">
<view class="price-text">{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">已到账</view>
<view class="price-text"
v-if="item.type">{{ type[item.type] }}{{ item.money }}</view>
<view class="price-text add"
v-else>{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">{{ state[item.state] }}</view>
</view>
</template>
</uv-cell>
@ -51,7 +57,7 @@
mixinsListApi : 'getWaterPageList',
list : [],
type : ['+', '-'],
state : ['审核中', '成功', '失败'],
state : ['未到账', '已到账'],
}
},
computed: {
@ -120,10 +126,12 @@
.cell-text{
text-align: right;
.price-text{
color: #f40;
font-size: 32rpx;
font-weight: 900;
}
.add{
color: #f40;
}
.tips{
font-size: 22rpx;
color: #aaa;


+ 1
- 0
pages_order/mine/recharge.vue View File

@ -103,6 +103,7 @@
title: '充值成功',
icon : 'none'
})
this.form.money = 0
setTimeout(uni.navigateBack, 800, -1)
}
})


+ 13
- 4
pages_order/mine/withdraw.vue View File

@ -50,8 +50,14 @@
:center="true">
<template #value>
<view class="cell-text">
<view class="price-text">{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">已到账</view>
<view class="price-text"
v-if="item.type">{{ type[item.type] }}{{ item.money }}</view>
<view class="price-text add"
v-else>{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">{{ state[item.state] }}</view>
</view>
</template>
</uv-cell>
@ -72,7 +78,7 @@
mixinsListApi : 'getWaterPageList',
list : [],
type : ['+', '-'],
state : ['审核中', '成功', '失败'],
state : ['未到账', '已到账'],
form : {
money : 0,
},
@ -111,6 +117,7 @@
title: '提现成功',
icon : 'none'
})
this.form.money = 0
this.$store.commit('getUserInfo')
this.$store.commit('getRiceInfo')
this.getData()
@ -195,10 +202,12 @@
.cell-text{
text-align: right;
.price-text{
color: #f40;
font-size: 32rpx;
font-weight: 900;
}
.add{
color: #f40;
}
.tips{
font-size: 22rpx;
color: #aaa;


+ 25
- 3
pages_order/order/createOrder.vue View File

@ -127,7 +127,7 @@
if([2].includes(n.type) &&
[1].includes(this.userInfo.isPay)){
//
//
price += n.vipPrice * n.num
}else{
//
@ -208,7 +208,9 @@
let data = {}
let api = ''
if(this.productList[0].type == 2){//
if(this.productList[0].shopId || this.productList[0].type == 2){//
let list = []
this.productList.forEach(n => {
list.push({
@ -221,11 +223,14 @@
list : JSON.stringify(list),
}
api = 'createSumOrder'
this.deleteCart(this.productList.map(n => n.id).join(','))
}else{//
data = {
addressId,
num : this.productList[0].num,
productId : this.productList[0].id,
shopId : this.productList[0].id,
}
api = 'createOrder'
}
@ -247,10 +252,27 @@
url: '/pages/index/order'
})
})
}else if(res.code == 902){
uni.showModal({
title: res.message,
success(e) {
if(e.confirm){
uni.redirectTo({
url: '/pages/index/order'
})
}
}
})
}
})
},
//
deleteCart(ids){
this.$api('deleteCart', {
ids
})
},
}
}
</script>


BIN
static/image/home/logo.png View File

Before After
Width: 2240  |  Height: 436  |  Size: 62 KiB

+ 3
- 3
uni_modules/uv-cell/components/uv-cell/uv-cell.vue View File

@ -9,7 +9,7 @@
<view class="uv-cell__body__content">
<view class="uv-cell__left-icon-wrap">
<slot name="icon">
<uv-icon v-if="icon" :name="icon" :custom-style="iconStyle" :size="size === 'large' ? 44 : 36"></uv-icon>
<uv-icon v-if="icon" :name="icon" :custom-style="iconStyle" :size="size === 'large' ? 50 : 44"></uv-icon>
</slot>
</view>
<view class="uv-cell__title">
@ -32,7 +32,7 @@
:class="[`uv-cell__right-icon-wrap--${arrowDirection}`]">
<slot name="right-icon">
<uv-icon v-if="isLink" :name="rightIcon" :custom-style="rightIconStyle" :color="disabled ? '#c8c9cc' : 'info'"
:size="size === 'large' ? 36 : 32"></uv-icon>
:size="size === 'large' ? 40 : 36"></uv-icon>
</slot>
</view>
</view>
@ -101,7 +101,7 @@
<style lang="scss" scoped>
@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
@import '@/uni_modules/uv-ui-tools/libs/css/color.scss';
$uv-cell-padding: 10px 15px !default;
$uv-cell-padding: 20px 15px !default;
$uv-cell-font-size: 15px !default;
$uv-cell-line-height: 24px !default;
$uv-cell-color: $uv-main-color !default;


+ 2
- 2
uni_modules/uv-number-box/components/uv-number-box/props.js View File

@ -51,7 +51,7 @@ export default {
// 输入框宽度,单位为px
inputWidth: {
type: [String, Number],
default: 35
default: 160
},
// 是否显示减少按钮
showMinus: {
@ -81,7 +81,7 @@ export default {
// 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
buttonSize: {
type: [String, Number],
default: 30
default: 60
},
// 输入框和按钮的背景颜色
bgColor: {


+ 3
- 3
uni_modules/uv-number-box/components/uv-number-box/uv-number-box.vue View File

@ -336,12 +336,12 @@
$uv-numberBox-hover-bgColor: #E6E6E6 !default;
$uv-numberBox-disabled-color: #c8c9cc !default;
$uv-numberBox-disabled-bgColor: #f7f8fa !default;
$uv-numberBox-plus-radius: 4px !default;
$uv-numberBox-minus-radius: 4px !default;
$uv-numberBox-plus-radius: 8px !default;
$uv-numberBox-minus-radius: 8px !default;
$uv-numberBox-input-text-align: center !default;
$uv-numberBox-input-font-size: 15px !default;
$uv-numberBox-input-padding: 0 !default;
$uv-numberBox-input-margin: 0 2px !default;
$uv-numberBox-input-margin: 0 4px !default;
$uv-numberBox-input-disabled-color: #c8c9cc !default;
$uv-numberBox-input-disabled-bgColor: #f2f3f5 !default;
.uv-number-box {


Loading…
Cancel
Save