Browse Source

上传

master
前端-胡立永 6 months ago
parent
commit
d0fc342659
30 changed files with 760 additions and 173 deletions
  1. +1
    -0
      App.vue
  2. +23
    -1
      api/model/index.js
  3. +15
    -2
      api/model/info.js
  4. +1
    -1
      components/base/tabbar.vue
  5. +2
    -1
      components/product/productItem.vue
  6. +1
    -1
      config.js
  7. +2
    -2
      mixins/list.js
  8. +11
    -1
      pages.json
  9. +27
    -19
      pages/index/cart.vue
  10. +14
    -26
      pages/index/category.vue
  11. +28
    -15
      pages/index/center.vue
  12. +63
    -19
      pages/index/index.vue
  13. +12
    -2
      pages/index/member.vue
  14. +3
    -0
      pages/index/order.vue
  15. +1
    -1
      pages_order/auth/wxUserInfo.vue
  16. +86
    -0
      pages_order/home/contact.vue
  17. +31
    -27
      pages_order/home/introduce.vue
  18. +7
    -5
      pages_order/home/journalism.vue
  19. +58
    -0
      pages_order/home/notice.vue
  20. +5
    -10
      pages_order/mine/balance.vue
  21. +4
    -10
      pages_order/mine/commission.vue
  22. +277
    -0
      pages_order/mine/promotion.vue
  23. +6
    -3
      pages_order/mine/recommend.vue
  24. +31
    -21
      pages_order/order/createOrder.vue
  25. +26
    -5
      pages_order/product/productDetail.vue
  26. BIN
      static/image/member/m0.png
  27. BIN
      static/image/member/m1.png
  28. BIN
      static/image/member/m2.png
  29. +24
    -0
      store/store.js
  30. +1
    -1
      uni_modules/uv-ui-tools/libs/css/color.scss

+ 1
- 0
App.vue View File

@ -2,6 +2,7 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
this.$store.commit('initConfig') this.$store.commit('initConfig')
this.$store.commit('getCategoryList')
}, },
onShow: function() { onShow: function() {
}, },


+ 23
- 1
api/model/index.js View File

@ -20,7 +20,7 @@ const api = {
}, },
// 获取首页新闻详情 // 获取首页新闻详情
getRiceNewsDetail: { getRiceNewsDetail: {
url: '/rice_index/getRiceNewsDetail',
url: '/rice_index/getCommonNewsDetail',
method: 'GET', method: 'GET',
}, },
// 获取首页新闻列表 // 获取首页新闻列表
@ -43,6 +43,28 @@ const api = {
url: '/rice_index/getRiceProductList', url: '/rice_index/getRiceProductList',
method: 'GET', method: 'GET',
}, },
// 查询分类接口
getCategoryList: {
url: '/rice_index/getCategoryList',
method: 'GET',
},
// 获取分类分页商品列表接口
getClassShopPageList: {
url: '/rice_index/getClassShopPageList',
method: 'GET',
},
// 加入购物车
addCart: {
url: '/rice_index/addCart',
method: 'GET',
auth : true,
},
// 创建订单
createOrder: {
url: '/rice_index/createOrder',
method: 'GET',
auth : true,
},
} }
export default api export default api

+ 15
- 2
api/model/info.js View File

@ -41,16 +41,29 @@ const api = {
getOrderPageList: { getOrderPageList: {
url: '/rice_info/getOrderPageList', url: '/rice_info/getOrderPageList',
method: 'GET', method: 'GET',
limit : 500,
auth : true, auth : true,
}, },
// 获取流水记录带分页 // 获取流水记录带分页
getWaterPageList: { getWaterPageList: {
url: '/rice_info/getWaterPageList', url: '/rice_info/getWaterPageList',
method: 'GET', method: 'GET',
limit : 500,
auth : true, auth : true,
}, },
// 获取相关介绍
getInfoIntroduce: {
url: '/rice_info/getInfoIntroduce',
method: 'GET',
},
// 获取相关介绍详情
getRiceInfo: {
url: '/rice_info/getRiceNewsDetail',
method: 'GET',
},
// 查询个人信息相关
getRiceInfo: {
url: '/rice_info/getRiceInfo',
method: 'GET',
},
} }
export default api export default api

+ 1
- 1
components/base/tabbar.vue View File

@ -65,7 +65,7 @@
}, },
methods : { methods : {
toPath(item, index){ toPath(item, index){
if(index == this.select){
if(item.key == this.select){
return return
} }
uni.reLaunch({ uni.reLaunch({


+ 2
- 1
components/product/productItem.vue View File

@ -1,7 +1,8 @@
<template> <template>
<view class="item" @click="$emit('click')"> <view class="item" @click="$emit('click')">
<view class="item-image"> <view class="item-image">
<image :src="item.image || 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'" mode="aspectFill">
<image :src="item.image &&
item.image.split(',')[0]" mode="aspectFill">
</image> </image>
</view> </view>


+ 1
- 1
config.js View File

@ -13,7 +13,7 @@ const type = 'dev'
// 环境配置 // 环境配置
const config = { const config = {
dev : { dev : {
baseUrl : 'https://admin.szqwdgidm.com/rice-admin',
baseUrl : 'http://h5.xzaiyp.top/rice-admin',
}, },
prod : { prod : {
baseUrl : 'https://admin.szqwdgidm.com/rice-admin', baseUrl : 'https://admin.szqwdgidm.com/rice-admin',


+ 2
- 2
mixins/list.js View File

@ -52,9 +52,9 @@ export default {
success(res.result) success(res.result)
this[this.mixinsListKey || 'list'] = res.result.records
this[this.mixinsListKey || 'list'] = res.result.records || res.result
this.total = res.result.total
this.total = res.result.total || res.result.length
} }
}) })
}) })


+ 11
- 1
pages.json View File

@ -48,7 +48,8 @@
}, },
"subPackages": [{ "subPackages": [{
"root": "pages_order", "root": "pages_order",
"pages": [{
"pages": [
{
"path": "order/orderDetail" "path": "order/orderDetail"
}, },
{ {
@ -101,6 +102,15 @@
}, },
{ {
"path": "mine/recharge" "path": "mine/recharge"
},
{
"path": "mine/promotion"
},
{
"path": "home/notice"
},
{
"path": "home/contact"
} }
] ]
}], }],


+ 27
- 19
pages/index/cart.vue View File

@ -26,7 +26,8 @@
<image <image
class="image" class="image"
src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg"
:src="item.image &&
item.image.split(',')[0]"
mode=""></image> mode=""></image>
<view class="info"> <view class="info">
@ -40,7 +41,7 @@
</view> </view>
</view> </view>
<view class="unit"> <view class="unit">
规格{{ item.unit }}
规格{{ item.sku }}
<uv-icon name="arrow-down"></uv-icon> <uv-icon name="arrow-down"></uv-icon>
</view> </view>
<view class="price"> <view class="price">
@ -71,7 +72,8 @@
{{ checkboxValue.length }}已享受更低优惠 {{ checkboxValue.length }}已享受更低优惠
</view> </view>
</view> </view>
<view class="btn">
<view class="btn"
@click="submit">
去结算 去结算
</view> </view>
</view> </view>
@ -101,22 +103,6 @@
} }
}, },
], ],
list : [
{
id : 1,
title : '桌布租赁',
num : 1,
price : 299,
unit : '120*40*75【桌子尺寸】',
},
{
id : 2,
title : '桌布租赁',
num : 1,
price : 299,
unit : '120*40*75【桌子尺寸】',
},
],
mixinsListApi : 'getCartPageList', mixinsListApi : 'getCartPageList',
} }
}, },
@ -138,6 +124,28 @@
valChange(){ valChange(){
}, },
//
submit(){
if(this.checkboxValue.length == 0){
uni.showToast({
title: '请选择商品',
icon: 'none',
})
return
}
let arr = []
this.list.forEach(n => {
if(this.checkboxValue.includes(n.id)){
arr.push(n)
}
})
this.$store.commit('setPayOrderProduct', arr)
this.$utils.navigateTo('/pages_order/order/createOrder')
},
} }
} }
</script> </script>


+ 14
- 26
pages/index/category.vue View File

@ -4,18 +4,17 @@
<view class="category"> <view class="category">
<uv-vtabs <uv-vtabs
:chain="chain"
:list="category" :list="category"
height="1000px"
keyName="title"
:barItemBadgeStyle="{right:'20px',top:'12px'}" :barItemBadgeStyle="{right:'20px',top:'12px'}"
@change="change"> @change="change">
<uv-vtabs-item> <uv-vtabs-item>
<view class="list"> <view class="list">
<productItem <productItem
v-for="(item, index) in 10"
v-for="(item, index) in list"
:key="index" :key="index"
:item="item" :item="item"
@click="$utils.navigateTo('/pages_order/product/productDetail?id=123')"
@click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)"
/> />
</view> </view>
</uv-vtabs-item> </uv-vtabs-item>
@ -28,6 +27,7 @@
<script> <script>
import productItem from '@/components/product/productItem.vue'; import productItem from '@/components/product/productItem.vue';
import mixinsList from '@/mixins/list.js' import mixinsList from '@/mixins/list.js'
import { mapState } from 'vuex'
export default { export default {
mixins : [mixinsList], mixins : [mixinsList],
components: { components: {
@ -35,34 +35,22 @@
}, },
data() { data() {
return { return {
category: [
{
name : '桌布'
},
{
name : '桌布'
},
{
name : '桌布'
},
],
value: 0
mixinsListApi : 'getClassShopPageList',
} }
}, },
computed: { computed: {
list2() {
const _list = this.list[this.value]?.childrens;
return _list ? _list : [];
}
...mapState(['category'])
}, },
onReady() {
onLoad() {
this.$store.commit('getCategoryList')
if(this.category.length > 0){
this.queryParams.classId = this.category[0].id
}
}, },
methods: { methods: {
change(index) {
console.log('选项改变:', index)
this.value = index;
}
change({index}) {
this.queryParams.classId = this.category[index].id
},
} }
} }
</script> </script>


+ 28
- 15
pages/index/center.vue View File

@ -10,7 +10,10 @@
<view class="info"> <view class="info">
<view class="name"> <view class="name">
<view class="one">{{ userInfo.nickName }}</view> <view class="one">{{ userInfo.nickName }}</view>
<view class="two">黄金会员</view>
<!-- <view class="two">黄金会员</view> -->
<view class="two">
<image :src="configList[vipImage[userInfo.isPay]]" mode=""></image>
</view>
</view> </view>
<view class="vip"> <view class="vip">
ID{{ userInfo.id }} ID{{ userInfo.id }}
@ -25,15 +28,16 @@
</view> </view>
<view class="earnings"> <view class="earnings">
<view class="member">
<view>会员等级黄金会员</view>
<view class="member"
v-if="userInfo.isPay">
<view>会员等级{{ vipType[userInfo.isPay] }}</view>
<view>查看权益></view> <view>查看权益></view>
</view> </view>
<view class="deposit"> <view class="deposit">
<view class="box" <view class="box"
@click="$utils.navigateTo('/pages_order/mine/balance')"> @click="$utils.navigateTo('/pages_order/mine/balance')">
<view> <view>
<view class="num">1.00</view>
<view class="num">{{ riceInfo.income || 0 }}</view>
<view class="text">收益明细()</view> <view class="text">收益明细()</view>
</view> </view>
<view class="boxs">收益明细</view> <view class="boxs">收益明细</view>
@ -41,7 +45,7 @@
<view class="box"> <view class="box">
<view <view
@click="$utils.navigateTo('/pages_order/mine/balance')"> @click="$utils.navigateTo('/pages_order/mine/balance')">
<view class="num">1.00</view>
<view class="num">{{ riceInfo.balance || 0 }}</view>
<view class="text">余额()</view> <view class="text">余额()</view>
</view> </view>
<view class="boxs" <view class="boxs"
@ -51,7 +55,7 @@
<view class="box"> <view class="box">
<view <view
@click="$utils.navigateTo('/pages_order/mine/commission')"> @click="$utils.navigateTo('/pages_order/mine/commission')">
<view class="num" style="border: none;">1.00</view>
<view class="num" style="border: none;">{{ riceInfo.canWithdraw || 0 }}</view>
<view class="text">可提现()</view> <view class="text">可提现()</view>
</view> </view>
<view class="boxs" <view class="boxs"
@ -107,7 +111,9 @@
</view> </view>
<view class="cell-bottom"> <view class="cell-bottom">
<uv-cell-group> <uv-cell-group>
<uv-cell icon="share" title="我的邀请码" :isLink="true" arrow-direction="right" />
<uv-cell icon="share" title="我的邀请码"
@click="$utils.navigateTo('/pages_order/mine/promotion')"
:isLink="true" arrow-direction="right" />
<uv-cell icon="share" title="我的推荐" :isLink="true" arrow-direction="right" <uv-cell icon="share" title="我的推荐" :isLink="true" arrow-direction="right"
@click="$utils.navigateTo('/pages_order/mine/recommend')" /> @click="$utils.navigateTo('/pages_order/mine/recommend')" />
@ -142,13 +148,17 @@
customerServicePopup, customerServicePopup,
}, },
computed: { computed: {
...mapState(['userInfo']),
...mapState(['userInfo', 'riceInfo']),
}, },
data() { data() {
return {}
return {
vipType : ['普通会员', '黄金会员', '渠道商'],
vipImage : ['vip_vip', 'vip_user', 'vip_shop']
}
}, },
onShow() { onShow() {
this.$store.commit('getUserInfo') this.$store.commit('getUserInfo')
this.$store.commit('getRiceInfo')
}, },
methods: {} methods: {}
} }
@ -162,7 +172,6 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
} }
.rect { .rect {
@ -244,11 +253,15 @@
} }
.two { .two {
font-size: 24rpx;
margin-left: 10rpx;
padding: 3rpx 16rpx;
border-radius: 18rpx;
background-color: rgb(252, 213, 157);
// font-size: 24rpx;
// margin-left: 10rpx;
// padding: 3rpx 16rpx;
// border-radius: 18rpx;
// background-color: rgb(252, 213, 157);
image{
width: 100rpx;
height: 50rpx;
}
} }
} }


+ 63
- 19
pages/index/index.vue View File

@ -9,9 +9,12 @@
{{ configList.index_title }} {{ configList.index_title }}
</view> </view>
<view class="search">
<uv-search placeholder="搜你喜欢的产品" bgColor="#fff" v-model="keyword"></uv-search>
</view>
<!-- <view class="search">
<uv-search
placeholder="搜你喜欢的产品"
bgColor="#fff"
v-model="keyword"></uv-search>
</view> -->
<view class="swipe"> <view class="swipe">
<uv-swiper <uv-swiper
@ -21,21 +24,24 @@
</view> </view>
<view class="notice"> <view class="notice">
<uv-notice-bar fontSize="32rpx" :text="notice"></uv-notice-bar>
<uv-notice-bar fontSize="32rpx"
@click="$utils.navigateTo('/pages_order/home/notice')"
:text="notice"></uv-notice-bar>
</view> </view>
<view class="menu"> <view class="menu">
<uv-grid :border="false" :col="4" > <uv-grid :border="false" :col="4" >
<uv-grid-item v-for="(item,index) in baseList" :key="index" <uv-grid-item v-for="(item,index) in baseList" :key="index"
@click="toUrl(item.url)"> @click="toUrl(item.url)">
<image :src="item.image" mode=""></image>
<image :src="item.image" mode="aspectFill"></image>
<text class="menu-text">{{item.title}}</text> <text class="menu-text">{{item.title}}</text>
</uv-grid-item> </uv-grid-item>
</uv-grid> </uv-grid>
</view> </view>
<view class="map">
<image :src="configList.index_center_image" mode="aspectFill" />
<view class="map"
v-if="configList.qd_image">
<image :src="configList.qd_image" mode="aspectFill" />
</view> </view>
<view class="commodity" <view class="commodity"
@ -59,7 +65,8 @@
<text class="text2">原价{{ item.oldPrice }}</text> <text class="text2">原价{{ item.oldPrice }}</text>
</view> </view>
<view class="box-img"> <view class="box-img">
<image :src="item.image" mode="aspectFill"></image>
<image :src="item.image &&
item.image.split(',')[0]" mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
@ -87,7 +94,8 @@
<text class="text2">原价{{ item.oldPrice }}</text> <text class="text2">原价{{ item.oldPrice }}</text>
</view> </view>
<view class="box-img"> <view class="box-img">
<image :src="item.image" mode="aspectFill"></image>
<image :src="item.image &&
item.image.split(',')[0]" mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
@ -110,10 +118,12 @@
<view class="centre"> <view class="centre">
<view class="boxs" <view class="boxs"
:key="index" :key="index"
@click="$utils.navigateTo('/pages_order/home/newsDetail?id=' + item.id)"
v-for="(item, index) in newList" v-for="(item, index) in newList"
> >
<view class="images"> <view class="images">
<image :src="item.image" mode="aspectFill"></image>
<image :src="item.image &&
item.image.split(',')[0]" mode="aspectFill"></image>
</view> </view>
<view class="box-fone"> <view class="box-fone">
<view>{{ item.title }}</view> <view>{{ item.title }}</view>
@ -130,12 +140,15 @@
<image :src="configList.down_image" mode="aspectFill"></image> <image :src="configList.down_image" mode="aspectFill"></image>
</view> </view>
<view class="qr-bottom"> <view class="qr-bottom">
<view>保存公众号二维码图片</view>
<view>长按识别公众号</view>
<view
@click="saveImage(configList.down_image)"
>保存公众号二维码图片</view>
</view> </view>
</view> </view>
<PrivacyAgreementPoup /> <PrivacyAgreementPoup />
<customerServicePopup ref="customerServicePopup"/>
<tabber select="home" /> <tabber select="home" />
</view> </view>
@ -146,15 +159,16 @@
import Position from '@/utils/position.js' import Position from '@/utils/position.js'
import tabber from '@/components/base/tabbar.vue' import tabber from '@/components/base/tabbar.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import customerServicePopup from '@/components/config/customerServicePopup.vue'
export default { export default {
components: { components: {
tabber, tabber,
PrivacyAgreementPoup, PrivacyAgreementPoup,
customerServicePopup,
}, },
data() { data() {
return { return {
area: '长沙',
notice: '长沙市刘师傅在服务过程中客户投诉“服务过程中有不文明的行为”.....',
notice: '',
bannerList: [], bannerList: [],
baseList: [ baseList: [
// { // {
@ -228,7 +242,7 @@
getRiceNoticeList(){ getRiceNoticeList(){
this.$api('getRiceNoticeList', res => { this.$api('getRiceNoticeList', res => {
if(res.code == 200){ if(res.code == 200){
this.notice = res.result.content
this.notice = res.result.title
} }
}) })
}, },
@ -272,10 +286,38 @@
}) })
return return
} }
if(url == '::phone'){
this.$refs.customerServicePopup.open()
return
}
uni.navigateTo({ uni.navigateTo({
url url
}) })
}, },
saveImage(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> </script>
@ -362,12 +404,11 @@
.map { .map {
margin: 20rpx; margin: 20rpx;
height: 100rpx;
border-radius: 16rpx; border-radius: 16rpx;
image { image {
width: 100%; width: 100%;
height: 100%;
height: 100rpx;
} }
} }
@ -427,7 +468,10 @@
width: 100%; width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 10rpx;
margin-top: 20rpx;
background-color: #f9f9f9;
border-radius: 20rpx;
padding: 20rpx;
.images { .images {
width: 180rpx; width: 180rpx;
@ -532,7 +576,7 @@
font-size: 28rpx; font-size: 28rpx;
color: #A2A2A2; color: #A2A2A2;
justify-content: space-around; justify-content: space-around;
padding-bottom: 20rpx;
view { view {
border: 2rpx solid #A2A2A2; border: 2rpx solid #A2A2A2;
padding: 20rpx; padding: 20rpx;


+ 12
- 2
pages/index/member.vue View File

@ -22,9 +22,10 @@
</view> </view>
<view class="di"> <view class="di">
<view class="pad"> <view class="pad">
1000/999
{{ riceInfo.memberNum }}/{{ configList.vip_open_num }}
</view> </view>
<view class="submitOpen">
<view class="submitOpen"
@click="submitOpen">
开通会员 开通会员
</view> </view>
</view> </view>
@ -143,6 +144,7 @@
<script> <script>
import tabber from '@/components/base/tabbar.vue' import tabber from '@/components/base/tabbar.vue'
import { mapState } from 'vuex'
export default { export default {
components: { components: {
tabber, tabber,
@ -153,9 +155,13 @@
vipInfoList: [], vipInfoList: [],
}; };
}, },
computed : {
...mapState(['userInfo', 'riceInfo']),
},
onShow() { onShow() {
this.getBanner() this.getBanner()
this.getRiceVipList() this.getRiceVipList()
this.$store.commit('getRiceInfo')
}, },
methods : { methods : {
// //
@ -174,6 +180,10 @@
} }
}) })
}, },
//
submitOpen(){
},
} }
} }
</script> </script>


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

@ -84,7 +84,9 @@
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import mixinsList from '@/mixins/list.js'
export default { export default {
mixins : [mixinsList],
components : { components : {
}, },
computed : { computed : {
@ -131,6 +133,7 @@
}, },
state : -1, state : -1,
current : 0, current : 0,
mixinsListApi : 'getOrderPageList',
} }
}, },
onLoad(args) { onLoad(args) {


+ 1
- 1
pages_order/auth/wxUserInfo.vue View File

@ -79,7 +79,7 @@
nickName : self.userInfo.nickName nickName : self.userInfo.nickName
}, res => { }, res => {
if (res.code == 200) { if (res.code == 200) {
uni.switchTab({
uni.reLaunch({
url:'/pages/index/index' url:'/pages/index/index'
}) })
} }


+ 86
- 0
pages_order/home/contact.vue View File

@ -0,0 +1,86 @@
<template>
<view class="page">
<navbar title="联系我们" leftClick @leftClick="$utils.navigateBack" />
<view class="box">
<view class="">
<image :src="configList.wx_image" mode="aspectFill"></image>
<view class="uni-color-btn"
@click="saveImage(configList.wx_image)">
保存二维码
</view>
</view>
<view class="">
联系电话{{ configList.phone }}
<view class="uni-color-btn"
@click="confirm">
拨打电话
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
//
confirm() {
uni.makePhoneCall({
phoneNumber: this.configList.phone,
success() {
console.log('安卓拨打成功');
},
fail() {
console.log('安卓拨打失败');
}
})
},
saveImage(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 scoped lang="scss">
.page{
.box{
display: flex;
justify-content: center;
align-items: center;
height: 70vh;
flex-direction: column;
gap: 40rpx;
image{
width: 400rpx;
height: 400rpx;
}
}
}
</style>

+ 31
- 27
pages_order/home/introduce.vue View File

@ -1,36 +1,36 @@
<template> <template>
<view class="page"> <view class="page">
<navbar title="公司介绍" leftClick @leftClick="$utils.navigateBack" />
<navbar :title="title[type]" leftClick @leftClick="$utils.navigateBack" />
<view class="box"> <view class="box">
<view class="box-imgs"> <view class="box-imgs">
<view>
<view class="box-img">
<view>公司介绍</view>
</view>
</view>
<view>
<view class="box-img">
<view>公司介绍</view>
</view>
</view>
<view>
<view class="box-img">
<view>公司介绍</view>
</view>
<view
:key="index"
@click="$utils.navigateTo(`/pages_order/home/notice?id=${item.id}&type=${type}`)"
class="box-img"
v-for="(item, index) in list">
<image :src="item.image" mode="aspectFill"></image>
<view>{{ item.title }}</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import mixinsList from '@/mixins/list.js'
export default { export default {
mixins: [mixinsList],
data() { data() {
return { return {
mixinsListApi: 'getInfoIntroduce',//
title : ['公司介绍', '产品介绍', '关于我们', '其他'],
type : 0,
} }
}, },
onLoad({type}) {
this.type = type || 0
this.queryParams.type = this.type
},
computed: {}, computed: {},
methods: {} methods: {}
} }
@ -43,26 +43,30 @@
.box { .box {
margin: 20rpx; margin: 20rpx;
image{
width: 220rpx;
height: 400rpx;
}
.box-imgs { .box-imgs {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap;
.box-img{ .box-img{
display: flex;
width: 220rpx;
height: 400rpx;
background-size: 100% 100%;
background-image: url(../../static/image/home/9.png);
justify-content: center;
align-items: center;
border-radius: 20rpx; border-radius: 20rpx;
overflow: hidden; overflow: hidden;
position: relative;
view{ view{
position: absolute;
left: 50%;
transform: translate(-50%);
bottom: 80rpx;
color: #fff; color: #fff;
margin-top: 200rpx;
padding: 10rpx 20rpx;
background-color: #A3D250; background-color: #A3D250;
border-radius: 30rpx; border-radius: 30rpx;
width: 80%;
height: 60rpx;
line-height: 60rpx;
text-align: center;
} }
} }
} }


+ 7
- 5
pages_order/home/journalism.vue View File

@ -1,10 +1,12 @@
<template> <template>
<view class="page"> <view class="page">
<navbar title="新闻中心" leftClick @leftClick="$utils.navigateBack" /> <navbar title="新闻中心" leftClick @leftClick="$utils.navigateBack" />
<view class="card" @click="$utils.navigateTo('/pages_order/home/newsDetail?id=' + item.id)"
<view class="card"
@click="$utils.navigateTo('/pages_order/home/newsDetail?id=' + item.id)"
v-for="(item, index) in list" :key="item.id"> v-for="(item, index) in list" :key="item.id">
<view class="card-img"> <view class="card-img">
<image :src="item.image" mode="aspectFill"></image>
<image :src="item.image &&
item.image.split(',')[0]" mode="aspectFill"></image>
</view> </view>
<view> <view>
{{ item.title }} {{ item.title }}
@ -37,10 +39,10 @@
background-color: #F3F3F3; background-color: #F3F3F3;
.card { .card {
margin: 20rpx;
margin: 30rpx;
background-color: #fff; background-color: #fff;
border-bottom-left-radius: 16rpx;
border-bottom-right-radius: 16rpx;
overflow: hidden;
border-radius: 20rpx;
.card-img { .card-img {
height: 250rpx; height: 250rpx;


+ 58
- 0
pages_order/home/notice.vue View File

@ -0,0 +1,58 @@
<template>
<!-- 公告 -->
<view class="page">
<navbar title="公告" leftClick @leftClick="$utils.navigateBack" />
<view style="padding: 20rpx;">
<uv-parse :content="notice"></uv-parse>
</view>
</view>
</template>
<script>
export default {
data() {
return {
notice : {},
id : 0,
title : '',
titles : ['公司介绍', '产品介绍', '关于我们', '其他'],
}
},
onLoad({id, type}) {
if(type){
this.title = this.titles[type]
}
if(id){
this.id = id
this.getInfoIntroduce()
}else{
this.getRiceNoticeList()
}
},
methods: {
//
getRiceNoticeList(){
this.$api('getRiceNoticeList', res => {
if(res.code == 200){
this.notice = res.result.content
}
})
},
//
getInfoIntroduce(){
this.$api('getInfoIntroduceDetail', {
id : this.id
}, res => {
if(res.code == 200){
this.notice = res.result.details
}
})
},
}
}
</script>
<style scoped lang="scss">
.page {
}
</style>

+ 5
- 10
pages_order/mine/balance.vue View File

@ -29,7 +29,7 @@
:center="true"> :center="true">
<template #value> <template #value>
<view class="cell-text"> <view class="cell-text">
<view class="price-text">-19.9</view>
<view class="price-text">{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">已到账</view> <view class="tips">已到账</view>
</view> </view>
</template> </template>
@ -47,15 +47,10 @@
mixins : [mixinsList], mixins : [mixinsList],
data() { data() {
return { return {
// mixinsListApi : 'getWaterPageList',
list : [
{
title : '直播收入',
type : 0,
createTime : '2021-12-12',
}
],
type : ['-', '+'],
mixinsListApi : 'getWaterPageList',
list : [],
type : ['+', '-'],
state : ['审核中', '成功', '失败'],
} }
}, },
methods: { methods: {


+ 4
- 10
pages_order/mine/commission.vue View File

@ -29,7 +29,7 @@
:center="true"> :center="true">
<template #value> <template #value>
<view class="cell-text"> <view class="cell-text">
<view class="price-text">-19.9</view>
<view class="price-text">{{ type[item.type] }}{{ item.money }}</view>
<view class="tips">已到账</view> <view class="tips">已到账</view>
</view> </view>
</template> </template>
@ -47,15 +47,9 @@
mixins : [mixinsList], mixins : [mixinsList],
data() { data() {
return { return {
// mixinsListApi : 'getWaterPageList',
list : [
{
title : '直播收入',
type : 0,
createTime : '2021-12-12',
}
],
type : ['-', '+'],
mixinsListApi : 'getWaterPageList',
type : ['+', '-'],
state : ['审核中', '成功', '失败'],
} }
}, },
methods: { methods: {


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

@ -0,0 +1,277 @@
<template>
<view class="promotion">
<navbar title="二维码" leftClick @leftClick="$utils.navigateBack" />
<view class="promotion-card">
<!-- <view class="user-info"> -->
<!-- <image class="image" :src="userInfo.headImage" mode="widthFix"></image> -->
<!-- <image class="image" src="../../static/logo.png" mode="widthFix"></image> -->
<!-- <view class="user-name">{{ userInfo.nickName }}</view> -->
<!-- <view class="user-name">湖南第一深情</view> -->
<!-- </view> -->
<!-- <view class="invitation-code-img">
<image
style="width: 400rpx;"
:src="imagePath" mode="widthFix"></image>
</view> -->
<image style="width: 100%;" :src="imagePath" mode="widthFix"></image>
<!-- <view class="invitation-code">加油站: {{ title }}</view> -->
<canvas id="myCanvas" type="2d" canvas-id="firstCanvas1"></canvas>
</view>
<view class="btns">
<view class="btn"
@click="preservationImg(imagePath)">保存</view>
<!-- <view class="btn">立即邀请</view> -->
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Promotion',
computed: {
...mapState(['userInfo']),
},
data() {
return {
url: '',
title: '123123',
baseUrl: 'https://dianpin-img.xzaiyp.top/',
canvas: {},
imagePath: '',
}
},
onShow() {
this.getQrCode()
this.$store.commit('getUserInfo')
},
methods: {
getQrCode() {
this.$api('getInviteCode', res => {
if (res.code == 200) {
this.url = res.result.url
this.title = res.result.name
this.draw()
}
})
},
draw() {
uni.showLoading({
title: "拼命绘画中..."
})
wx.createSelectorQuery()
.select('#myCanvas') // canvasid
.fields({
node: true,
size: true
})
.exec((res) => {
const canvas = res[0].node
//
const ctx = canvas.getContext('2d')
// Canvas
const width = res[0].width
const height = res[0].height
//
const dpr = wx.getWindowInfo().pixelRatio
//dpr
// dpr 2 4
// 3 6
let Ratio = dpr * 2
console.log("bug", dpr)
canvas.width = width * dpr
canvas.height = height * dpr
this.canvas = canvas
ctx.scale(dpr, dpr)
ctx.clearRect(0, 0, width, height)
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
//
// const image = canvas.createImage()
// image.onload = () => {
// ctx.drawImage(image, 30, 18, 40, 40)
// }
// image.src = '/public/img/wechar_1.png'
// image.src = this.userInfo.headImage
ctx.fillStyle = 'black'
ctx.font = '22px PingFangSC-regular';
let s = this.title || '加油站'
ctx.fillText(s, canvas.width / Ratio - s.length * 11, 50);
//
const coderImage = canvas.createImage()
coderImage.src = this.baseUrl + this.url
coderImage.onload = () => {
ctx.drawImage(coderImage,
canvas.width / Ratio - 240 / 2, 100, 240, 240)
}
//
setTimeout(() => {
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: this.canvas.width,
height: this.canvas.height,
canvas,
success: (res) => {
var tempFilePath = res.tempFilePath;
this.imagePath = tempFilePath
uni.hideLoading()
}
});
}, 600);
})
},
back() {
uni.navigateBack(-1)
},
preservationImg(img) {
let that = this
uni.authorize({
/* scope.writePhotosAlbum 类型是保存到相册 */
scope: 'scope.writePhotosAlbum',
success() {
/* 已授权进入 */
/* 保存图片到相册方法方法 */
that.imgApi(img);
},
complete(res) {
/* 判断如果没有授权就打开设置选项让用户重新授权 */
uni.getSetting({
success(res) {
if (!res.authSetting['scope.writePhotosAlbum']) {
/* 打开设置的方法 */
that.openInstall();
}
}
});
}
});
},
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 {
.promotion-card {
width: 90%;
margin: 100rpx auto 0rpx auto;
box-shadow: 0rpx 0rpx 15rpx rgba(0, 0, 0, .2);
border-radius: 15rpx;
padding: 40rpx 30rpx;
box-sizing: border-box;
.user-info {
display: flex;
align-items: center;
.image {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.user-name {
font-size: 30rpx;
}
}
.invitation-code-img {
display: flex;
align-items: center;
justify-content: center;
margin: 100rpx 0rpx;
.image {
width: 30%;
border-radius: 50%;
}
}
.invitation-code {
text-align: center;
color: #818181;
font-size: 28rpx;
}
}
.btns {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 120rpx;
display: flex;
background: $uni-color;
color: white;
font-size: 28rpx;
.btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
&:nth-child(2) {
background: orange;
}
}
}
}
#myCanvas {
position: fixed;
left: 100%;
/* visibility: hidden */
/* visibility: hidden; */
/* margin-top: 100rpx; */
margin: 68rpx auto;
width: 750rpx;
height: 750rpx;
/* line-height: 20px; */
background-color: rgba(255, 255, 255, 1);
text-align: center;
}
</style>

+ 6
- 3
pages_order/mine/recommend.vue View File

@ -3,8 +3,8 @@
<navbar title="推广明细" leftClick @leftClick="$utils.navigateBack" /> <navbar title="推广明细" leftClick @leftClick="$utils.navigateBack" />
<view class="top"> <view class="top">
<view class="top-text"> <view class="top-text">
<view>100</view>
<view>直推人数()</view>
<view>{{ total }}</view>
<view>直推人数</view>
</view> </view>
</view> </view>
<view class="cell"> <view class="cell">
@ -18,7 +18,9 @@
:label="item.createTime" :label="item.createTime"
:center="true"> :center="true">
<template #value> <template #value>
<text style="font-weight: 600; font-size: 28rpx;">黄金会员</text>
<text style="font-weight: 600; font-size: 28rpx;">
{{ vipType[item.isPay] }}
</text>
</template> </template>
</uv-cell> </uv-cell>
</uv-cell-group> </uv-cell-group>
@ -34,6 +36,7 @@
data() { data() {
return { return {
mixinsListApi : 'getFansPageList', mixinsListApi : 'getFansPageList',
vipType : ['普通会员', '黄金会员', '渠道商'],
} }
}, },
onLoad(e) {}, onLoad(e) {},


+ 31
- 21
pages_order/order/createOrder.vue View File

@ -10,7 +10,7 @@
{{ address.name }} {{ address.name }}
</view> </view>
<view class=""> <view class="">
{{ address.addressDetail }}
{{ address.address }}
</view> </view>
<view class="icon"> <view class="icon">
<uv-icon size="30rpx" name="arrow-right"></uv-icon> <uv-icon size="30rpx" name="arrow-right"></uv-icon>
@ -22,8 +22,9 @@
:key="index" :key="index"
v-for="(item, index) in productList"> v-for="(item, index) in productList">
<view class="item-image"> <view class="item-image">
<image :src="item.image || 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg'"
mode="aspectFill"></image>
<image :src="item.image &&
item.image.split(',')[0]"
mode="aspectFill"></image>
</view> </view>
<view class="info"> <view class="info">
@ -36,7 +37,7 @@
<view class="price"> <view class="price">
<view class=""> <view class="">
<uv-number-box <uv-number-box
v-model="num"
v-model="item.num"
></uv-number-box> ></uv-number-box>
</view> </view>
<view class=""> <view class="">
@ -72,7 +73,8 @@
</view> </view>
<view class="uni-color-btn">
<view class="uni-color-btn"
@click="submit">
确认下单 确认下单
</view> </view>
</view> </view>
@ -90,17 +92,17 @@
<script> <script>
import addressList from '../components/address/addressList.vue' import addressList from '../components/address/addressList.vue'
import { mapState } from 'vuex'
export default { export default {
components: { components: {
addressList, addressList,
}, },
data() { data() {
return { return {
pids: [],
productList: [], productList: [],
address: { address: {
name: '请选择地址', name: '请选择地址',
addressDetail: '',
address: '',
}, },
addressTotal: 0, addressTotal: 0,
remark : '', remark : '',
@ -112,16 +114,14 @@
let price = 0 let price = 0
this.productList.forEach(n => { this.productList.forEach(n => {
price += n.price * this.num
price += n.price * n.num
}) })
return Number(price).toFixed(2) return Number(price).toFixed(2)
}, },
...mapState(['payOrderProduct']),
}, },
onLoad({
pid
}) {
this.pids = pid ? pid.split(',') : [],
onLoad() {
this.getRiceProductDetail() this.getRiceProductDetail()
}, },
onShow() { onShow() {
@ -130,15 +130,7 @@
methods: { methods: {
// //
getRiceProductDetail() { getRiceProductDetail() {
this.pids.forEach(id => {
this.$api('getRiceProductDetail', {
id
}, res => {
if (res.code == 200) {
this.productList.push(res.result)
}
})
})
this.productList = JSON.parse(JSON.stringify(this.payOrderProduct))
}, },
// //
getAddressList() { getAddressList() {
@ -164,6 +156,24 @@
this.address = e this.address = e
this.$refs.addressPopup.close() this.$refs.addressPopup.close()
}, },
//
submit(){
this.$api('createOrder', {
productId : this.productList[0].id,
num : 1,
}, res => {
if(res.code == 200){
uni.showToast({
title: '购买成功',
icon: 'none'
})
setInterval(uni.navigateTo, 1000, {
url : '/pages/index/order'
})
}
})
},
} }
} }
</script> </script>


+ 26
- 5
pages_order/product/productDetail.vue View File

@ -7,13 +7,14 @@
<view class="swipe"> <view class="swipe">
<uv-swiper <uv-swiper
:list="productDetail.image.split(',')"
:list="productDetail.image
&& productDetail.image.split(',')"
indicator indicator
height="520rpx"></uv-swiper> height="520rpx"></uv-swiper>
</view> </view>
<view class="info"> <view class="info">
<view class="">
<view style="width: 440rpx;">
<view class="title"> <view class="title">
{{ productDetail.title }} {{ productDetail.title }}
</view> </view>
@ -35,7 +36,8 @@
<!-- 分享和购买按钮 --> <!-- 分享和购买按钮 -->
<submit <submit
@submit="$utils.navigateTo('/pages_order/order/createOrder?pid=' + id)"
@addCart="addCart"
@submit="submit"
/> />
<!-- <submit <!-- <submit
@ -60,7 +62,7 @@
data() { data() {
return { return {
productDetail : { productDetail : {
image : 'https://cdn.uviewui.com/uview/swiper/swiper3.png,https://cdn.uviewui.com/uview/swiper/swiper2.png',
image : '',
details : '', details : '',
}, },
id : 0, id : 0,
@ -77,9 +79,14 @@
share(){ share(){
}, },
//
//
submit(){ submit(){
this.$store.commit('setPayOrderProduct', [
this.productDetail
])
this.$utils.navigateTo('/pages_order/order/createOrder')
}, },
// //
getRiceProductDetail(){ getRiceProductDetail(){
@ -87,10 +94,24 @@
id : this.id id : this.id
}, res => { }, res => {
if(res.code == 200){ if(res.code == 200){
res.result.num = 1
this.productDetail = res.result this.productDetail = res.result
} }
}) })
}, },
addCart(){
this.$api('addCart', {
productId : this.id,
num : 1,
}, res => {
if(res.code == 200){
uni.showToast({
title: '加入购物车成功',
icon: 'none'
})
}
})
},
} }
} }
</script> </script>


BIN
static/image/member/m0.png View File

Before After
Width: 232  |  Height: 80  |  Size: 9.9 KiB

BIN
static/image/member/m1.png View File

Before After
Width: 232  |  Height: 80  |  Size: 8.6 KiB

BIN
static/image/member/m2.png View File

Before After
Width: 232  |  Height: 80  |  Size: 7.3 KiB

+ 24
- 0
store/store.js View File

@ -10,6 +10,9 @@ const store = new Vuex.Store({
state: { state: {
configList: {}, //配置列表 configList: {}, //配置列表
userInfo : {}, //用户信息 userInfo : {}, //用户信息
riceInfo : {},//用户相关信息
category : [],//分类信息
payOrderProduct : [],//支付订单中的商品
}, },
getters: { getters: {
}, },
@ -74,6 +77,15 @@ const store = new Vuex.Store({
} }
}) })
}, },
getRiceInfo(state){
api('getRiceInfo', {
token : uni.getStorageSync('token') || ''
},res => {
if(res.code == 200){
state.riceInfo = res.result
}
})
},
// 退出登录 // 退出登录
logout(state){ logout(state){
uni.showModal({ uni.showModal({
@ -90,6 +102,18 @@ const store = new Vuex.Store({
} }
}) })
}, },
// 查询分类接口
getCategoryList(state){
api('getCategoryList', res => {
if(res.code == 200){
state.category = res.result
}
})
},
// 设置支付订单中的商品
setPayOrderProduct(state, data){
state.payOrderProduct = data
},
}, },
actions: {}, actions: {},
}) })


+ 1
- 1
uni_modules/uv-ui-tools/libs/css/color.scss View File

@ -6,7 +6,7 @@ $uv-border-color: #dadbde !default;
$uv-bg-color: #f3f4f6 !default; $uv-bg-color: #f3f4f6 !default;
$uv-disabled-color: #c8c9cc !default; $uv-disabled-color: #c8c9cc !default;
$uv-primary: #FD5100 !default;
$uv-primary: #A3D250 !default;
// $uv-primary: #3c9cff !default; // $uv-primary: #3c9cff !default;
$uv-primary-dark: #398ade !default; $uv-primary-dark: #398ade !default;
$uv-primary-disabled: #9acafc !default; $uv-primary-disabled: #9acafc !default;


Loading…
Cancel
Save