| | |
| | | }) |
| | | } |
| | | // #endif |
| | | |
| | | // #ifdef PUB_CUSTOMER |
| | | , |
| | | async submitShopping(dto) { |
| | | //提交到购物车中 |
| | | this.$message.showLoading() |
| | | await this.$store.dispatch('submitShopping',dto); |
| | | this.$message.hideLoading() |
| | | } |
| | | // #endif |
| | | } |
| | | } |
| | | export default mixinsCommon |
| | |
| | | "easycom": {
|
| | | "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
| | | },
|
| | | "pages": [{
|
| | | "pages": [
|
| | | {
|
| | | "path": "pages/login/supplier-login",
|
| | | "style": {
|
| | | "navigationBarTitleText": "登录",
|
| | | "enablePullDownRefresh": false,
|
| | | "navigationStyle": "custom"
|
| | | }
|
| | | }, {
|
| | | },
|
| | | {
|
| | | "path": "pages/home/supplier-home",
|
| | | "style": {
|
| | | "navigationBarTitleText": "首页",
|
| | | "enablePullDownRefresh": true,
|
| | | "navigationStyle": "custom"
|
| | | }
|
| | |
|
| | | },
|
| | | // #ifdef PUB_CUSTOMER
|
| | | {
|
| | |
| | | "enablePullDownRefresh": true,
|
| | | "navigationStyle": "custom"
|
| | | }
|
| | |
|
| | | },
|
| | | {
|
| | | "path": "pages/user/address/address",
|
| | |
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | }
|
| | |
|
| | | ],
|
| | |
|
| | | "subPackages": [{
|
| | | "subPackages": [
|
| | | {
|
| | | "root": "sub_pages/supplier",
|
| | | "pages": [
|
| | | // #ifdef PUB_SUPPLIER
|
| | |
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | |
|
| | | {
|
| | | "path": "order-sale/order-sale",
|
| | | "style": {
|
| | |
| | | "navigationBarTitleText": "扣款记录",
|
| | | "enablePullDownRefresh": true,
|
| | | "navigationBarBackgroundColor": "#E6F2EB"
|
| | |
|
| | | }
|
| | | },
|
| | |
|
| | | {
|
| | | "path": "protocol",
|
| | | "style": {
|
| | |
| | | }
|
| | | }
|
| | | ]
|
| | |
|
| | |
|
| | | }, {
|
| | | },
|
| | | {
|
| | | "root": "sub_pages/partner",
|
| | | "pages": [
|
| | | // #ifdef PUB_PARTNER
|
| | |
| | | "enablePullDownRefresh": false
|
| | | }
|
| | | },
|
| | |
|
| | | {
|
| | | "path": "order-manage/order-manage",
|
| | | "style": {
|
| | |
| | | }
|
| | | // #endif
|
| | | ]
|
| | | }, {
|
| | | },
|
| | | {
|
| | | "root": "sub_pages/customer",
|
| | | "pages": [
|
| | | // #ifdef PUB_CUSTOMER
|
| | |
| | | }
|
| | | },
|
| | | {
|
| | | "path": "shopping/confirm",
|
| | | "style": {
|
| | | "navigationBarTitleText": "订单详情"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "trade/list",
|
| | | "style": {
|
| | | "navigationBarTitleText": "商品列表",
|
| | |
| | | "style": {
|
| | | "navigationBarTitleText": "商品详情",
|
| | | "enablePullDownRefresh": false
|
| | |
|
| | | }
|
| | | },
|
| | | {
|
| | |
| | | "style": {
|
| | | "navigationBarTitleText": "商家主页"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "self/follow",
|
| | | "style": {
|
| | | "navigationBarTitleText": "我的关注",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | },
|
| | | {
|
| | | "path": "self/collect",
|
| | | "style": {
|
| | | "navigationBarTitleText": "我的收藏",
|
| | | "enablePullDownRefresh": true
|
| | | }
|
| | | }
|
| | | // #endif
|
| | | ]
|
| | | }],
|
| | | }
|
| | | ],
|
| | | "globalStyle": {
|
| | | "navigationBarTextStyle": "black",
|
| | | "navigationBarTitleText": "花满芫",
|
| | |
| | | <template> |
| | | <view class="home-price"> |
| | | <view class="flex t1"> |
| | | <view>2024-06-03 09:20:19 花满芜成交均价</view> |
| | | <view>2024-06-03 09:20:19 花满芫成交均价</view> |
| | | <uni-icons class="m-l-a m-r-0" type="right"></uni-icons> |
| | | </view> |
| | | <view class="items" style="border-top: 2rpx solid #EEEEEE;"> |
| | | <view class="flex" style="border-bottom: 2rpx solid #EEEEEE;padding-top: 24rpx;"> |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list1[0]&&list1[0].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | {{list1[0]&&list1[0].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list1[0]"> |
| | | <view class="m-l-a m-r-a">{{list1[0]&&list1[0].avePriceDifference<0?'-':'+'}}{{list1[0]&&list1[0].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list1[0]&&list1[0].avePriceDifferenceRate<0?'-':'+'}}{{list1[0]&&list1[0].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | <view class="line"></view> |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list1[1]&&list1[1].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | |
| | | {{list1[1]&&list1[1].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list1[1]"> |
| | | <view class="m-l-a m-r-a">{{list1[1]&&list1[1].avePriceDifference<0?'-':'+'}}{{list1[1]&&list1[1].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list1[1]&&list1[1].avePriceDifferenceRate<0?'-':'+'}}{{list1[1]&&list1[1].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | <view class="line"></view> |
| | | |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list1[2]&&list1[2].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | {{list1[2]&&list1[2].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list1[2]"> |
| | | <view class="m-l-a m-r-a">{{list1[2]&&list1[2].avePriceDifference<0?'-':'+'}}{{list1[2]&&list1[2].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list1[2]&&list1[2].avePriceDifferenceRate<0?'-':'+'}}{{list1[2]&&list1[2].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- <u-divider></u-divider> --> |
| | | <view class="flex" style="padding-top: 24rpx;"> |
| | | <view class="flex" style="padding-top: 24rpx;" v-if="list2.length>0"> |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list2[0]&&list2[0].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | {{list2[0]&&list2[0].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list2[0]"> |
| | | <view class="m-l-a m-r-a">{{list2[0]&&list2[0].avePriceDifference<0?'-':'+'}}{{list2[0]&&list2[0].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list2[0]&&list2[0].avePriceDifferenceRate<0?'-':'+'}}{{list2[0]&&list2[0].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | <view class="line"></view> |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list2[1]&&list2[1].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | |
| | | {{list2[1]&&list2[1].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list2[1]"> |
| | | <view class="m-l-a m-r-a">{{list2[1]&&list2[1].avePriceDifference<0?'-':'+'}}{{list2[1]&&list2[1].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list2[1]&&list2[1].avePriceDifferenceRate<0?'-':'+'}}{{list2[1]&&list2[1].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | <view class="line"></view> |
| | | |
| | | <view class="item flex1"> |
| | | <view class="title">单头玫瑰</view> |
| | | <view class="title">{{list2[2]&&list2[2].name||''}}</view> |
| | | <view class="price"> |
| | | 19.66 |
| | | {{list2[2]&&list2[2].avePrice||''}} |
| | | </view> |
| | | <view class="flex desc"> |
| | | <view class="m-l-a m-r-a">+0.76</view> |
| | | <view class="m-l-a m-r-a text-right">+4.02%</view> |
| | | <view class="flex desc" v-if="list2[2]"> |
| | | <view class="m-l-a m-r-a">{{list2[2]&&list2[2].avePriceDifference<0?'-':'+'}}{{list2[2]&&list2[2].avePriceDifference||''}}</view> |
| | | <view class="m-l-a m-r-a text-right">{{list2[2]&&list2[2].avePriceDifferenceRate<0?'-':'+'}}{{list2[2]&&list2[2].avePriceDifferenceRate*100||''}}%</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | list1: [], |
| | | list2: [], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | |
| | | const { |
| | | data |
| | | } = await this.$http.request('get', '/api/pub/customer/home', { |
| | | size: 6, |
| | | }) |
| | | var list = data && data.records || [] |
| | | this.list1 = [] |
| | | this.list2 = [] |
| | | for (var i = 0; i < list.length && i < 3; i++) { |
| | | this.list1.push(list[i]) |
| | | } |
| | | for (var i = 3; i < list.length && i < 6; i++) { |
| | | this.list2.push(list[i]) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <form class="cl">
|
| | | <view class="t-a titles-top">
|
| | | <view class="title-1">HELLO</view>
|
| | | <view class="title-2">欢迎登录<span class="title-3">花满芜</span> |
| | | <view class="title-2">欢迎登录<span class="title-3">花满芫</span>
|
| | | <!-- #ifdef PUB_SUPPLIER --> |
| | | <span>供应商管理平台</span> |
| | | <!-- #endif --> |
| | |
| | | <form class="cl"> |
| | | <view class="t-a titles-top"> |
| | | <view class="title-1">HELLO</view> |
| | | <view class="title-2">欢迎入驻<span class="title-3">花满芜</span></view> |
| | | <view class="title-2">欢迎入驻<span class="title-3">花满芫</span></view> |
| | | </view> |
| | | |
| | | |
| | |
| | | @click="protocal=!protocal" class="component-radio" :class="[protocal?'cur':'']"> |
| | | |
| | | </view> |
| | | <view class="topic-gray" @click="toProtocol">请仔细阅读《花满芜合伙人供应商入口小程序隐私保护指引》如您同意该指引,请勾选开始使用本小程序 |
| | | <view class="topic-gray" @click="toProtocol">请仔细阅读《花满芫合伙人供应商入口小程序隐私保护指引》如您同意该指引,请勾选开始使用本小程序 |
| | | </view> |
| | | </view> |
| | | </form> |
| | |
| | | import http from '../plugins/http' |
| | | import storage from '../plugins/storage.js' |
| | | import message from '../plugins/message.js' |
| | | // #ifndef VUE3 |
| | | import Vue from 'vue' |
| | | import Vuex from 'vuex' |
| | | |
| | | Vue.use(Vuex) |
| | | const store = new Vuex.Store({ |
| | | // #endif |
| | | |
| | | |
| | | |
| | | // #ifdef VUE3 |
| | | import { |
| | | createStore |
| | | } from 'vuex' |
| | | const store = createStore({ |
| | | // #endif |
| | | state: { |
| | | hasLogin: false, |
| | | isUniverifyLogin: false, |
| | |
| | | 'enterprise': 0, |
| | | 'info': 0, |
| | | 'flower': 0, |
| | | 'shopping': 0, |
| | | }, |
| | | defaultaddress: {} |
| | | }, |
| | |
| | | }) { |
| | | //把权限获取到 |
| | | // console.log('getCurrentInfo,getCurrentInfo') |
| | | const currentInfo = await http.request('get', '/api/current/user', { |
| | | |
| | | }) |
| | | const currentInfo = await http.request('get', '/api/current/user', {}) |
| | | if (currentInfo && currentInfo.code == 0) { |
| | | // state.cMenu = cMenu |
| | | // state.roles = currentInfo.data.roles || [] |
| | |
| | | } |
| | | |
| | | }, |
| | | submitShopping: async function ({commit, dispatch}, data) { |
| | | const resp = await http.request('post', '/api/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: data.id, |
| | | num: 1 |
| | | } |
| | | } |
| | | ) |
| | | if (resp && resp.code === 0) { |
| | | message.showToast('添加购物车成功') |
| | | dispatch('sign_add', 'shopping') |
| | | } else { |
| | | |
| | | } |
| | | return resp |
| | | }, |
| | | |
| | | } |
| | | }) |
对比新文件 |
| | |
| | | <template> |
| | | <view class="page-collect"> |
| | | <view class="search-container m-t-12 flex"> |
| | | <view class="flex1 input"> |
| | | <u-input placeholder="请输入花名" v-model="query.name"> |
| | | <template slot="suffix"> |
| | | <uni-icons color="#20613D" type="search" size="24" @tap="refreshList"></uni-icons> |
| | | </template> |
| | | </u-input> |
| | | </view> |
| | | </view> |
| | | <view class="component-filter-container"> |
| | | <view class="flex1"> |
| | | 排序 |
| | | <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image> |
| | | </view> |
| | | <view class="flex1"> |
| | | {{ this.query.levelStr || '级别' }} |
| | | <image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down" |
| | | @click="level_show=true"></image> |
| | | </view> |
| | | </view> |
| | | |
| | | <u-picker :show="level_show" @confirm="select_level" keyName="label" :columns="level_columns" |
| | | @cancel="level_show=false"></u-picker> |
| | | <u-picker :show="order_show" @confirm="select_order" keyName="label" :columns="order_columns" |
| | | @cancel="order_show=false"></u-picker> |
| | | |
| | | <view class="trade-list-container"> |
| | | <view class="trade-info-container" v-for="(dto,index) of list" :key="index"> |
| | | <view class="title"> |
| | | <view class="level m-r-15">{{dto.levelStr || '-'}}级</view> |
| | | <view class=""> |
| | | {{dto.name || '-'}} |
| | | </view> |
| | | </view> |
| | | <view class="desc m-t-12"> |
| | | <view class="m-r-15">已售:{{ dto.sales || 0}}</view> |
| | | <view class="m-r-15">剩余:{{dto.stock || 0}}</view> |
| | | <view class=" ">{{dto.unit||'-'}}支/扎</view> |
| | | </view> |
| | | <view class="flex m-t-12"> |
| | | <view class="price m-r-a"> |
| | | <span class="num">{{dto.price||'-'}}</span> |
| | | 元/扎 |
| | | </view> |
| | | <view class="m-l-a m-r-15"> |
| | | <image src="../../../static/common/icon-kf.png" class="icon-kf m-l-15 img100"></image> |
| | | |
| | | </view> |
| | | <view class="m-r-0 gwc" @click="submitShopping(dto)"> |
| | | + 购物车 |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | async onPullDownRefresh() { |
| | | await this.refreshList() |
| | | uni.stopPullDownRefresh() |
| | | }, |
| | | data() { |
| | | return { |
| | | query: { |
| | | name: '', |
| | | levelStr: '', |
| | | level: '', |
| | | column:'', |
| | | columnStr:'', |
| | | }, |
| | | level_show: false, |
| | | level_columns: [[]], |
| | | |
| | | order_show:false, |
| | | order_columns:[[]] |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.listApi = '/api/collect/list' |
| | | this.$http.request('get', '/api/code/value', { |
| | | params: { |
| | | type: 'FLOWER_LEVEL' |
| | | } |
| | | }).then(res => { |
| | | var data = res.data |
| | | this.level_columns = [data || []] |
| | | this.columns_levels[0].unshift({ |
| | | label: '全部', |
| | | value: '' |
| | | }) |
| | | }) |
| | | |
| | | this.$http.request('get', '/api/code/value', { |
| | | params: { |
| | | type: 'FLOWER_ORDER_BY' |
| | | } |
| | | }).then(res => { |
| | | var data = res.data |
| | | this.order_columns = [data || []] |
| | | this.order_columns[0].unshift({ |
| | | label: '默认', |
| | | value: '' |
| | | }) |
| | | }) |
| | | }, |
| | | methods: { |
| | | select_level(e) { |
| | | this.level_show = false |
| | | this.query.levelStr = e.value[0].label |
| | | this.query.level = e.value[0].value |
| | | }, |
| | | select_order(e) { |
| | | this.order_show = false |
| | | this.query.columnStr = e.value[0].label |
| | | this.query.column = e.value[0].value |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .page-collect { |
| | | .search-container { |
| | | display: flex; |
| | | margin: 12rpx 0rpx 20rpx 0rpx; |
| | | position: relative; |
| | | z-index: 1; |
| | | |
| | | .input { |
| | | background-color: #fff !important; |
| | | border-radius: 8rpx; |
| | | } |
| | | |
| | | .button { |
| | | min-width: 120rpx; |
| | | max-width: 120rpx; |
| | | margin-left: auto; |
| | | margin-right: 0rpx; |
| | | text-align: right; |
| | | line-height: 70rpx !important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <view> |
| | | |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | |
| | | } |
| | | }, |
| | | async onPullDownRefresh() { |
| | | await this.refreshList() |
| | | uni.stopPullDownRefresh() |
| | | }, |
| | | onLoad(){ |
| | | this.listApi = '/api/follow/list' |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | </style> |
对比新文件 |
| | |
| | | <script> |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | |
| | | export default { |
| | | name: "订单详情", |
| | | computed: { |
| | | ...mapState({ |
| | | address: state => { |
| | | return state.defaultaddress || {} |
| | | }, |
| | | }), |
| | | }, |
| | | watch: { |
| | | // address(nv, ov) { |
| | | // if (nv && nv.id) { |
| | | // //尝试更新一下 |
| | | // |
| | | // } |
| | | // } |
| | | }, |
| | | async onShow() { |
| | | setTimeout(async () => { |
| | | if (this.address && this.address.id && this.cacheAddressId !== this.address.id) { |
| | | this.$message.showLoading() |
| | | const {code, data} = await this.$http.request('get', '/api/flower/customer/order/confirm/transports', { |
| | | data: { |
| | | addressId: this.address.id, |
| | | weight: this.dto.totalWeight || 0 |
| | | } |
| | | }) |
| | | this.$message.hideLoading() |
| | | this.transportList = [] |
| | | if (code === 0) { |
| | | this.transportList = data || [] |
| | | } |
| | | } |
| | | }, 200) |
| | | }, |
| | | onLoad(options) { |
| | | let item = JSON.parse(decodeURIComponent(options.query.dto)); |
| | | this.dto = { |
| | | ...this.dto, |
| | | ...item |
| | | } |
| | | //先获取直接的全部地址 |
| | | // @ApiModelProperty(value = "订单商品") |
| | | // private List<FlowerCartListDTO> flowers; |
| | | // @ApiModelProperty(value = "打包费") |
| | | // private BigDecimal packing; |
| | | //todo 显示打包费等,然后再确认 |
| | | // https://lanhuapp.com/web/#/item/project/detailDetach?pid=05830e81-7c59-4655-8253-4deb7c913b51&project_id=05830e81-7c59-4655-8253-4deb7c913b51&image_id=f7cc3e57-5367-4b99-a84e-99c38249aa66&fromEditor=true |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | dto: {}, |
| | | cacheAddressId: '', |
| | | transportList: [], |
| | | // private Long id; |
| | | // @ApiModelProperty(value = "名称") |
| | | // private String name; |
| | | // @ApiModelProperty(value = "英文名") |
| | | // private String enName; |
| | | // @ApiModelProperty(value = "运费") |
| | | // private BigDecimal fee; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <view class="page-confirm"> |
| | | <view> |
| | | <common-address-select ref="addressselect"></common-address-select> |
| | | </view> |
| | | <view> |
| | | <!-- todo 查看商品列表,和选择运费 --> |
| | | </view> |
| | | <view class="bottom-price flex"> |
| | | <view> |
| | | 合计:¥ {{ dto.totalAmount||0 }} 元 |
| | | </view> |
| | | <view class="button-green-1"> |
| | | 提交订单 |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <style scoped lang="scss"> |
| | | .page-confirm{ |
| | | |
| | | .bottom-price { |
| | | position: fixed; |
| | | left: 0rpx; |
| | | padding: 20rpx; |
| | | right: 0rpx; |
| | | bottom: 160rpx; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <view class="shopping-container"> |
| | | <view class="top-title"> 苏州市一价全含,市区内包邮派送到店 |
| | | </view> |
| | | <view class="top-desc"> |
| | | 全程鲜花冷链专线,时效快,损耗小 |
| | | </view> |
| | | <view class="flex"> |
| | | <image class="icon-clock m-r-6" src="../../../static/common/icon-call.png"></image> |
| | | <view class="name"> |
| | | 客服电话 : <span class="topic-gray">{{ tel }}</span> |
| | | </view> |
| | | </view> |
| | | <view class=""> |
| | | <no-data v-if="!list||list.length===0" style="width: 100%;"></no-data> |
| | | <view class="shopping-item m-t-20" v-for="(item,index) of list" :key="index"> |
| | | <u-swipe-action> |
| | | <u-swipe-action-item |
| | | :options="options1" |
| | | @click="(e)=>{clickSwipeButton(item)}" |
| | | > |
| | | <view class="sup-title"> |
| | | <radio :checked="ids.indexOf(item.id)>=0" @change="changeItem(item,'supplier')">></radio> |
| | | {{ item.supplierName || '-' }} |
| | | </view> |
| | | <u-divider></u-divider> |
| | | <view v-for="(dto,j) of item.flowerList" :key="j"> |
| | | <u-divider v-if="j>0"></u-divider> |
| | | <view class="item-each flex"> |
| | | <radio :checked="ids.indexOf(dto.id)>=0" @change="changeItem(dto,'flower')"></radio> |
| | | <image class="img img100 m-r-6" :src="dto.url||dto.cover"></image> |
| | | <view> |
| | | <view class="title"><span>{{ dto.levelStr || '-' }}</span> {{ dto.name || '-' }}</view> |
| | | <view class="price"> |
| | | {{ dto.price || '-' }}元/扎 |
| | | </view> |
| | | <view class="desc m-t-12"> |
| | | <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view> |
| | | </view> |
| | | <view class="button-icons flex"> |
| | | <uni-icons v-if="dto.num&&dto.num>=1" type="minus" size="32" |
| | | @click="addnum(dto,-1)"></uni-icons> |
| | | <view class="curnums" v-if="dto.num&&dto.num>=1">{{ dto.num }}</view> |
| | | <uni-icons type="plus-filled" size="32" @click="addnum(dto,1)"></uni-icons> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-swipe-action-item> |
| | | </u-swipe-action> |
| | | </view> |
| | | |
| | | </view> |
| | | <view style="min-height:200rpx"> |
| | | </view> |
| | | <view class="bottom-price flex"> |
| | | <view> |
| | | <radio :checked="checkall" @change="selectAll"></radio> |
| | | 全选 |
| | | </view> |
| | | <view> |
| | | 合计:¥ {{ totalprice }} 元 |
| | | </view> |
| | | <view class="button-green-1"> |
| | | 提交订单 |
| | | </view> |
| | | </view> |
| | | <view style="min-height:200rpx"> |
| | | </view> |
| | | <common-footer flg="2"></common-footer> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import http from "../../../plugins/http"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | tel: '15974805814', |
| | | ids: [], |
| | | checkall: false, |
| | | options1: [{ |
| | | text: '删除' |
| | | }] |
| | | } |
| | | }, |
| | | onShow() { |
| | | if (this.sign['shopping']) { |
| | | this.init() |
| | | } |
| | | }, |
| | | onLoad() { |
| | | this.init() |
| | | }, |
| | | computed: { |
| | | totalprice() { |
| | | |
| | | let totalprice = 0 |
| | | this.list.forEach(dto => { |
| | | dto.flowerList.forEach(item => { |
| | | if (this.ids.indexOf(item.id) >= 0) { |
| | | totalprice += item.price * item.num |
| | | } |
| | | }) |
| | | }) |
| | | return totalprice.toFixed(2) |
| | | }, |
| | | methods: { |
| | | async submitPay() { |
| | | // order/confirm/info |
| | | var arr = [] |
| | | for (var j = 0; j < this.list.flowerList; j++) { |
| | | |
| | | if (this.ids.indexOf(this.list.flowerList[j].id) >= 0) { |
| | | arr.push({ |
| | | id: this.list.flowerList[j].id, |
| | | num: this.list.flowerList[j].num |
| | | }) |
| | | } |
| | | } |
| | | if (this.arr.length < 1) { |
| | | return |
| | | } |
| | | this.$message.showLoading() |
| | | const {code, data} = await http.request('post', '/api/api/customer/order/confirm/info', { |
| | | data: { |
| | | flowers: arr, |
| | | } |
| | | } |
| | | ) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | uni.navigateTo({ |
| | | url: '/sub_pages/customer/shopping/confirm?dto=' + +encodeURIComponent(JSON.stringify(data)) |
| | | }) |
| | | } |
| | | }, |
| | | async clickSwipeButton(item) { |
| | | //删除商品,重新加载数据? |
| | | |
| | | this.$message.showLoading() |
| | | const {code} = await http.request('post', '/api/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: dto.id, |
| | | num: addnum |
| | | } |
| | | } |
| | | ) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | if (this.ids.indexOf(item.id) >= 0) { |
| | | this.ids.splice(this.ids.indexOf(item.id), 1) |
| | | } |
| | | for (var i = 0; i < this.list.length; i++) { |
| | | if (this.list[i].id === dto.supplierId) { |
| | | this.list[i].splice(i, 1) |
| | | if (this.list.flowerList.length === 1) { |
| | | if (this.ids.indexOf(this.list[i].id) >= 0) { |
| | | this.ids.splice(this.ids.indexOf(this.list[i].id), 1) |
| | | } |
| | | this.list[i].flowerList.splice(0, 1) |
| | | this.list.splice(i, 1) |
| | | } else { |
| | | //只需要清楚这个元素 |
| | | var k = -1 |
| | | for (var j = 0; j < this.list[i].flowerList.length; j++) { |
| | | if (this.list[i][j].id === item.id) { |
| | | k = j; |
| | | break |
| | | } |
| | | } |
| | | this.list[i].flowerList.splice(k, 1) |
| | | } |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | selectAll() { |
| | | if (this.checkall) { |
| | | this.ids = [] |
| | | this.checkall = false |
| | | } else { |
| | | list.for(dto => { |
| | | if (this.ids.indexOf(dto.id) < 0) { |
| | | this.ids.push(dto.id) |
| | | } |
| | | dto.flowerList.forEach(item => { |
| | | if (this.ids.indexOf(item.id) < 0) { |
| | | this.ids.push(item.id) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | changeItem(dto, type) { |
| | | if (type === 'supplier') { |
| | | //全选上 |
| | | if (this.ids.indexOf(dto.id) < 0) { |
| | | this.ids.push(dto.id) |
| | | dto.flowerList.forEach(item => { |
| | | if (this.ids.indexOf(item.id) < 0) { |
| | | this.ids.push(item.id) |
| | | } |
| | | }) |
| | | } else { |
| | | this.checkall = false |
| | | this.ids.splice(this.ids.indexOf(dto.id), 1) |
| | | dto.flowerList.forEach(item => { |
| | | this.ids.splice(this.ids.indexOf(item.id), 1) |
| | | }) |
| | | } |
| | | |
| | | } else { |
| | | //更换个人的 |
| | | if (this.ids.indexOf(dto.id) < 0) { |
| | | this.ids.push(dto.id) |
| | | } else { |
| | | this.checkall = false |
| | | |
| | | if (this.ids.indexOf(dto.supplierId) >= 0) { |
| | | this.ids.splice(this.ids.indexOf(dto.supplierId), 1) |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | async addnum(dto, addnum) { |
| | | if (dto.num + addnum >= 0) { |
| | | |
| | | } else { |
| | | return |
| | | } |
| | | this.$message.showLoading() |
| | | const {code} = await http.request('post', '/api/api/customer/flower/cart/change-num', { |
| | | data: { |
| | | id: dto.id, |
| | | num: addnum |
| | | } |
| | | } |
| | | ) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | dto.num += addnum |
| | | } |
| | | }, |
| | | async init() { |
| | | this.$message.showLoading() |
| | | await this.$store.dispatch('sign_clear', 'shopping'); |
| | | const {code, data} = await this.$http.request('get', '/api/customer/flower/cart/list', {}) |
| | | this.$message.hideLoading() |
| | | this.list = [] |
| | | if (code === 0) { |
| | | this.list = data.list || [] |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | <style lang="scss" scoped> |
| | | .shopping-container { |
| | | background-color: rgba(255, 255, 255, 0.4); |
| | | padding: 20rpx 30rpx; |
| | | |
| | | .bottom-price { |
| | | position: fixed; |
| | | left: 0rpx; |
| | | padding: 20rpx; |
| | | right: 0rpx; |
| | | bottom: 160rpx; |
| | | } |
| | | |
| | | .shopping-item { |
| | | padding: 28rpx 22rpx; |
| | | position: relative; |
| | | |
| | | .sup-title { |
| | | |
| | | } |
| | | |
| | | .item-each { |
| | | padding-left: 88rpx; |
| | | |
| | | .img { |
| | | width: 124rpx; |
| | | height: 124rpx; |
| | | } |
| | | |
| | | .title { |
| | | font-weight: 600; |
| | | font-size: 28rpx; |
| | | |
| | | color: #000000; |
| | | line-height: 40rpx; |
| | | |
| | | .level { |
| | | color: #20613D; |
| | | } |
| | | } |
| | | |
| | | .price { |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #CF0000; |
| | | line-height: 40rpx; |
| | | } |
| | | |
| | | .desc { |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | line-height: 34rpx; |
| | | } |
| | | } |
| | | |
| | | .button-icons { |
| | | position: absolute; |
| | | } |
| | | } |
| | | |
| | | .top-title { |
| | | font-size: 28rpx; |
| | | color: #000000; |
| | | line-height: 40rpx; |
| | | } |
| | | |
| | | .top-desc { |
| | | font-size: 24rpx; |
| | | color: #666666; |
| | | line-height: 34rpx; |
| | | } |
| | | |
| | | .top-kf { |
| | | background: linear-gradient(270deg, rgba(219, 244, 229, 0) 0%, #D5ECDE 100%); |
| | | border-radius: 8rpx; |
| | | font-weight: 400; |
| | | font-size: 24rpx; |
| | | color: #20613D; |
| | | line-height: 52rpx; |
| | | height: 52rpx; |
| | | padding-left: 26rpx; |
| | | |
| | | .icon-clock { |
| | | margin-top: 9rpx; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template>
|
| | | <view class="trade-detail">
|
| | | <view class="top-img-container">
|
| | | <image src="" class="top-img"></image>
|
| | | <image :src="dto.cover" class="top-img"></image>
|
| | | <view class="icon-container">
|
| | | <image src="../../../static/common/icon-sc.png" class="icon-sc"></image>
|
| | | <view class="num">12</view>
|
| | |
| | |
|
| | | </view>
|
| | | </view>
|
| | | <view class="info-container">
|
| | | <view class="trade-info-container">
|
| | | <view class="title">
|
| | | <view class="level m-r-15">B级</view>
|
| | | <view class="level m-r-15">{{ dto.levelStr || '-' }}级</view>
|
| | | <view class="">
|
| | | {{dto.name || '-'}}
|
| | | </view>
|
| | | </view>
|
| | | <view class="desc m-t-12">
|
| | | <view class="m-r-15">已售:7</view>
|
| | | <view class="m-r-15">剩余:13</view>
|
| | | <view class=" ">10支/扎</view>
|
| | | <view class="m-r-15">已售:{{ dto.sales || 0 }}</view>
|
| | | <view class="m-r-15">剩余:{{ dto.stock || 0 }}</view>
|
| | | <view class=" ">{{ dto.unit || '-' }}支/扎</view>
|
| | | </view>
|
| | | <view class="flex m-t-12">
|
| | | <view class="price m-r-a">
|
| | | <span class="num">28.01</span>
|
| | | <span class="num">{{ dto.price || '-' }}</span>
|
| | | 元/扎
|
| | | </view>
|
| | | <view class="m-l-a m-r-15">
|
| | | <image src="../../../static/common/icon-kf.png" class="icon-kf m-l-15 img100"></image>
|
| | |
|
| | | </view>
|
| | | <view class="m-r-0 gwc">
|
| | | <view class="m-r-0 gwc" @click="submitShopping(dto)">
|
| | | + 购物车
|
| | | </view>
|
| | | </view>
|
| | |
| | | <view class="line">
|
| | |
|
| | | </view>
|
| | | <view class="info-detail">
|
| | | <view class="info-detail" v-if="dto.params">
|
| | | <view class="title-before-blue" style="padding-top: 0rpx;padding-bottom: 0rpx;">详情</view>
|
| | | <view class="flex m-t-8">
|
| | | <view class="label">枝长:</view>
|
| | | <view class="value">70-75cm</view>
|
| | | <view class="flex m-t-8" v-for="(param,index) of dto.params" :key="index">
|
| | | <view class="label">{{ param.name}}:</view>
|
| | | <view class="value">{{ param.value || '-'}}</view>
|
| | | </view>
|
| | | <view class="flex m-t-8">
|
| | | <view class="label">枝粗:</view>
|
| | | <view class="value">中等粗细</view>
|
| | | </view>
|
| | | <view class="flex m-t-8">
|
| | | <view class="label">均匀度:</view>
|
| | | <view class="value">1-2支不均匀</view>
|
| | | </view>
|
| | | <!-- <view class="flex m-t-8">-->
|
| | | <!-- <view class="label">枝粗:</view>-->
|
| | | <!-- <view class="value">中等粗细</view>-->
|
| | | <!-- </view>-->
|
| | | <!-- <view class="flex m-t-8">-->
|
| | | <!-- <view class="label">均匀度:</view>-->
|
| | | <!-- <view class="value">1-2支不均匀</view>-->
|
| | | <!-- </view>-->
|
| | | </view>
|
| | | <view class="line">
|
| | |
|
| | |
| | | <view class="flex">
|
| | | <image class="store-logo"></image>
|
| | | <view>
|
| | | <view class="store-name">花仙子</view>
|
| | | <view class="store-address">云南省-昆明市-官渡区</view>
|
| | | <view class="store-name">{{dto.supplierName||'-'}}</view>
|
| | | <view class="store-address">{{dto.supplierStation||'-'}}</view>
|
| | | </view>
|
| | | <view class="store-to m-l-a m-r-0">进入店铺</view>
|
| | | </view>
|
| | | </view>
|
| | | <view class="m-t-20 shop-recommend-container">
|
| | | <view class="m-t-20 shop-recommend-container" v-if="false">
|
| | | <view class="shop-recommend-title">店铺推荐</view>
|
| | | <view class="flex">
|
| | | <view v-for="i in 3" :key="i" class="shop-recommend">
|
| | |
| | | <view class="line">
|
| | |
|
| | | </view>
|
| | | <view class="comment-container m-t-12">
|
| | | <view class="comment-container m-t-12" v-if="false">
|
| | | <view class="title-before-blue" style="padding-top: 0rpx;padding-bottom: 0rpx;">
|
| | | <view>评价</view>
|
| | | <view class="desc">
|
| | |
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | dto: {
|
| | |
|
| | | id: '',
|
| | | dto: {}
|
| | | }
|
| | | },
|
| | | onLoad(options) {
|
| | | this.id = options.id || ''
|
| | | if (this.id) {
|
| | | this.getDetail()
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | async getDetail() {
|
| | | this.$message.showLoading()
|
| | | const {
|
| | | code,
|
| | | data
|
| | | } = await this.$http.request('get', '/api/customer/flower/list/view', {
|
| | | params: {
|
| | | id: this.id
|
| | | }
|
| | | })
|
| | | if (code === 0) {
|
| | | this.dto = {
|
| | | ...data,
|
| | | }
|
| | | }
|
| | |
|
| | | this.$message.hideLoading()
|
| | |
|
| | | },
|
| | | openbrand() {
|
| | | uni.navigateTo({
|
| | | url: '/sub_pages/customer/shop/shop?id=' + (this.dto.id || '')
|
| | |
| | | .trade-detail {
|
| | | background-color: #FFFFFF;
|
| | |
|
| | | .info-container {
|
| | | .trade-info-container {
|
| | | padding: 46rpx 30rpx;
|
| | | border-radius: 40rpx 40rpx 0rpx 0rpx;
|
| | |
|
| | |
| | | line-height: 40rpx;
|
| | |
|
| | | .level {
|
| | | color: #20613D;
|
| | | ;
|
| | | color: #20613D;;
|
| | | }
|
| | | }
|
| | | }
|