This commit is contained in:
weipengfei 2023-09-08 18:54:23 +08:00
commit afce5ed5e5
12 changed files with 1204 additions and 948 deletions

88
App.vue
View File

@ -204,6 +204,8 @@
this.checknetwork()
}, },
onShow() { onShow() {
let that = this let that = this
@ -244,10 +246,81 @@
// }) // })
}); });
uni.setTabBarItem((e) => { console.log("点击了", e)}); uni.setTabBarItem((e) => {
console.log("点击了", e)
});
}, },
methods: { methods: {
//
checknetwork() {
uni.onNetworkStatusChange(function(res) {
if (res.isConnected) {
uni.reLaunch({
url: '/pages/index/index'
})
} else {
uni.showModal({
title: '系统提示',
content: '当前设备无网络或网络较差',
cancelText: '取消',
confirmText: '确定',
success: (res) => {
if (res.confirm) {
uni.reLaunch({
url: '/pages/index/index'
})
} else {
// #ifdef H5
uni.navigateTo({
url: '/pages/users/login/login_copy'
})
// #endif
// #ifdef APP-PLUS
plus.runtime.quit()
// #endif
}
}
})
}
})
},
/** /**
* 语音播报 * 语音播报
* *
@ -401,12 +474,13 @@
margin-top: -50rpx; margin-top: -50rpx;
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3); // box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
} }
.custom_style-txt{
display: flex; .custom_style-txt {
flex-direction: column; display: flex;
align-items: center; flex-direction: column;
margin-top: 5rpx; align-items: center;
margin-top: 5rpx;
} }
} }

View File

@ -7,4 +7,36 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import request from "@/utils/request.js"; import request from "@/utils/request.js";
//发布委托商品选择 供应链商家接口
export function supplychain(data) {
return request.get("community/supplychain/list", data);
}
//普通商家发布委托商品
export function entrustchain(data) {
return request.post("community/entrust", data);
}
//获取委托商品列表
export function entrustlist(data) {
return request.get("community/entrust/list", data);
}
//供应链商家是否同意委托
export function checkchain(id,data) {
return request.post("community/entrust/check/"+id, data);
}
//供应链商家申请结束委托
export function finishchain(id,data) {
return request.post("community/entrust/apply/finish/"+id, data);
}
//委托商品加入购物车
export function addEntrustCart(data) {
return request.post("community/entrust/addEntrustCart", data);
}

View File

@ -7,7 +7,7 @@
<view id="left" v-if="leftList.length"> <view id="left" v-if="leftList.length">
<view v-for="(item,index) in leftList" :key="index" <view v-for="(item,index) in leftList" :key="index"
class="wf-itema" @tap="itemTap(item)"> class="wf-itema" @tap="itemTap(item)">
<WaterfallsFlowItem :item="item" :isStore="isStore" :userid='userid' :type="type" @goShop="goShop"/> <WaterfallsFlowItem :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
</view> </view>
</view> </view>
</view> </view>
@ -16,7 +16,7 @@
<view id="right" v-if="rightList.length"> <view id="right" v-if="rightList.length">
<view v-for="(item,index) in rightList" :key="index" <view v-for="(item,index) in rightList" :key="index"
class="wf-itemb" @tap="itemTap(item)"> class="wf-itemb" @tap="itemTap(item)">
<WaterfallsFlowItem :item="item" :isStore="isStore" :userid='userid' :type="type" @goShop="goShop"/> <WaterfallsFlowItem :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
</view> </view>
</view> </view>
</view> </view>
@ -25,9 +25,7 @@
<script> <script>
import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItems.vue' import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItems.vue'
import {
getUserInfo
} from '@/api/user.js';
export default { export default {
components: { components: {
WaterfallsFlowItem WaterfallsFlowItem
@ -58,7 +56,7 @@ export default {
rightList: [], // rightList: [], //
mark: 0, // mark: 0, //
boxHeight: [], // 01 boxHeight: [], // 01
userid:'',
}; };
}, },
watch: { watch: {
@ -118,18 +116,9 @@ export default {
} }
} }
}, },
mounted(){
this.getUserInfo()
},
methods: { methods: {
/**
* 获取个人用户信息
*/
getUserInfo(){
getUserInfo().then(res => {
this.userid = res.data.uid
});
},
// //
waterFall() { waterFall() {
@ -179,7 +168,7 @@ export default {
}, },
// item // item
itemTap(item) { itemTap(item) {
// this.$emit('itemTap', item) this.$emit('itemTap', item)
}, },
// item // item
goShop(item) { goShop(item) {

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="wf-item-page" @click="gogogo(item)"> <view class="wf-item-page">
<image :src="item.image[0]" mode="widthFix" class="item-img" /> <image :src="item.image[0]" mode="widthFix" class="item-img" />
@ -21,47 +21,21 @@
item: { item: {
type: Object, type: Object,
require: true require: true
}, }
userid: {
type: String | Number,
require: true
},
}, },
data() { data() {
return { return {
user_id: ''
} }
}, },
methods: { methods: {
gogogo(item) {
if (this.userid) {
if (item.video_link.length > 0) {
uni.navigateTo({
// #ifdef MP || H5
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif
// #ifdef APP
url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif
})
} else {
uni.navigateTo({
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
})
}
} else {
this.$util.Tips({
title: '用户信息不存在,请完成登录在进行该操作',
icon: 'error'
})
}
},
} }

View File

@ -5,7 +5,7 @@
<block v-for="(item,index) in imgUrls" :key='index'> <block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item> <swiper-item>
<image :src="item" class="slide-image" /> <image :src="item" class="slide-image" mode="aspectFit" />
<!-- <view class="stop" v-if="isType == 2"> <!-- <view class="stop" v-if="isType == 2">
<image class="image" src="/static/images/stop.png"></image> <image class="image" src="/static/images/stop.png"></image>
</view> --> </view> -->

View File

@ -1,5 +1,32 @@
{ {
"pages": [ "pages": [
//#ifdef APP-PLUS
//
{
"path": "pages/guide/judge",
"style": {
"enablePullDownRefresh": false,
"onReachBottomDistance": 100,
"navigationStyle": "custom",
"app-plus": {
"contentAdjust": false,
"bounce": "none"
}
}
},
{
"path": "pages/guide/guide",
"style": {
"enablePullDownRefresh": false,
"onReachBottomDistance": 100,
"navigationStyle": "custom",
"app-plus": {
"contentAdjust": false,
"bounce": "none"
}
}
},
// #endif
//pageshttps://uniapp.dcloud.io/collocation/pages //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/index/index",
@ -992,13 +1019,13 @@
"style": { "style": {
"navigationBarTitleText": "订单列表" "navigationBarTitleText": "订单列表"
} }
},{ }, {
"path": "financial_management/index", "path": "financial_management/index",
"style": { "style": {
"navigationBarTitleText": "财务管理" "navigationBarTitleText": "财务管理"
} }
}, },
{ {
"path": "orderRefund/index", "path": "orderRefund/index",
"style": { "style": {
@ -1559,13 +1586,13 @@
"selectedColor": "#E93323", "selectedColor": "#E93323",
"borderStyle": "white", "borderStyle": "white",
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"list": [{ "list": [{
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"iconPath": "static/tabbar_icon/a.png", "iconPath": "static/tabbar_icon/a.png",
"selectedIconPath": "static/tabbar_icon/a-a.png", "selectedIconPath": "static/tabbar_icon/a-a.png",
"text": "泸州" "text": "泸州"
}, },
{ {
"pagePath": "pages/gather/gather", "pagePath": "pages/gather/gather",
@ -1593,8 +1620,7 @@
"selectedIconPath": "static/tabbar_icon/e-a.png", "selectedIconPath": "static/tabbar_icon/e-a.png",
"text": "我的" "text": "我的"
} }
] ],
,
"midButton": { "midButton": {
"width": "68px", "width": "68px",
"height": "70px", "height": "70px",

View File

@ -821,8 +821,10 @@
// //
get_product_list: function(isPage) { get_product_list: function(isPage) {
let that = this; let that = this;
if (that.loadend) return; if (that.loadend) return;
if (that.loading) return; if (that.loading) return;
console.log(that.loadend,that.loading)
if (isPage === true) that.$set(that, 'productList', []); if (isPage === true) that.$set(that, 'productList', []);
that.loading = true; that.loading = true;
that.loadTitle = ''; that.loadTitle = '';

View File

@ -9,15 +9,15 @@
<view class="item-one"> <view class="item-one">
被委托商家 被委托商家
</view> </view>
<e-select v-model="value1" :options="options1" placeholder="选择选项"></e-select> <e-select v-model="formData.entrust_mer_id" :options="options1" placeholder="选择选项"></e-select>
</view> </view>
<view class="release_item-one"> <view class="release_item-one">
<view class="item-one"> <view class="item-one">
委托周期 委托周期
</view> </view>
<view class="" @click="calendar"> <view class="">
<input type="number" v-model="date" /> <input type="number" v-model="formData.entrust_day" />
</view> </view>
<!-- <e-select v-model="value1" :options="options1" placeholder="选择选项"></e-select> --> <!-- <e-select v-model="value1" :options="options1" placeholder="选择选项"></e-select> -->
</view> </view>
@ -57,13 +57,11 @@
</view> </view>
</view> </view>
<button class="release_btn button" form-type="submit">提交</button>
</view> </view>
</form> </form>
<button class="release_btn button" form-type="submit">提交</button>
<uni-calendar ref="calendar" :date="info.date" :insert="info.insert" :lunar="info.lunar"
:startDate="info.startDate" :endDate="info.endDate" :range="info.range" @confirm="confirm"
:showMonth="info.showMonth" @close="close" />
<!-- 提到的宝贝弹窗 --> <!-- 提到的宝贝弹窗 -->
<uni-popup ref="associated" type="bottom"> <uni-popup ref="associated" type="bottom">
<associated @close="close" @getProduct="getProduct" :checkedObj="productList"></associated> <associated @close="close" @getProduct="getProduct" :checkedObj="productList"></associated>
@ -74,7 +72,10 @@
<script> <script>
import associated from '@/components/realselist/realselist.vue'; import associated from '@/components/realselist/realselist.vue';
import eselect from '@/components/e-select/e-select.vue'; import eselect from '@/components/e-select/e-select.vue';
// import {} from '@/api/sale.js' import {
supplychain,
entrustchain
} from '@/api/sale.js'
export default { export default {
components: { components: {
associated, associated,
@ -84,20 +85,8 @@
return { return {
value1: 1, value1: 1,
value2: "", value2: "",
options1: [{ options1: [],
text: "Shenzhen1",
value: 1
}, {
text: "Shenzhen2",
value: 2
}, {
text: "Shenzhen3",
value: 3
}],
date: 1,
productList: [], productList: [],
info: { info: {
startDate: '', startDate: '',
@ -108,6 +97,14 @@
selected: [], selected: [],
showMonth: false showMonth: false
}, },
formData: {
entrust_mer_id: '',
entrust_day: 0,
is_type: "4",
product_info: [],
content: ''
},
type: ''
}; };
}, },
computed: { computed: {
@ -116,27 +113,42 @@
}, },
onLoad(options) { onLoad(e) {
this.id = e.id;
this.type = e.type
if (this.type) {
uni.setNavigationBarTitle({
title: '编辑打折'
})
} else {
}
},
mounted() {
this.list()
}, },
methods: { methods: {
list() {
// supplychain({
confirm(e) { page: 1
}).then((res => {
let self = this
if (e.range.after && e.range.before) { for (let i in res.data.list) {
let star = new Date(e.range.after).getTime() this.options1.push({
let stop = new Date(e.range.before).getTime() text: res.data.list[i].mer_name,
let arr = stop - star value: res.data.list[i].mer_id
this.date = Math.floor(arr / (24 * 3600 * 1000)); })
// console.log(days)
if (this.date < 0) {
this.date = this.date * -1
} }
}
// console.log(res)
}))
}, },
calendar() { calendar() {
this.$refs.calendar.open() this.$refs.calendar.open()
}, },
@ -150,16 +162,65 @@
}, },
// //
getProduct(data) { getProduct(data) {
console.log(data)
if (data.length > 0) {
for (let i in data) {
this.formData.content+=data[i].store_name+','
this.formData.product_info.push({
product_attr_unique: data[i].product_attr_unique,
number: Number(data[i].number),
price: data[i].price
})
}
}
this.$refs.associated.close() this.$refs.associated.close()
}, },
// //
formSubmit(e) { formSubmit(e) {
console.log(e) console.log(e)
this.$util.Tips({ let that = this,
title: res.message, value = that.formData;
icon: 'success'
if (value.entrust_day.length == 0 || value.entrust_day <= 0) return that.$util.Tips({
title: '请选择委托周期'
});
if (value.product_info.length == 0) return that.$util.Tips({
title: '请选择产品'
});
if (!value.entrust_mer_id) return that.$util.Tips({
title: '请添加商家'
});
entrustchain(value).then(res => {
if (res.status == '200') {
uni.hideLoading()
that.$util.Tips({
title: '提交成功',
icon: 'success'
});
that.formData = {
entrust_mer_id: '',
entrust_day: 0,
is_type: "4",
product_info: []
}
uni.redirectTo({
url: '/pages/commissionedSales/initiateDelegation/index'
})
} else {
that.$util.Tips({
title: res.messge,
icon: 'success'
});
}
}).catch(err => {
return that.$util.Tips({
title: err
});
}) })
} }
} }
} }

View File

@ -14,17 +14,17 @@
</view> </view>
<view class="content-one-txt"> <view class="content-one-txt">
<view class="one-txt-a"> <view class="one-txt-a">
{{item.content}} {{item.title}}
</view> </view>
<view class="one-txt-b"> <view class="one-txt-b">
委托周期:{{item.day}} 委托周期:{{item.credit_buy}}
</view> </view>
</view> </view>
</view> </view>
<view class="content-two_one" v-if="item.type==1"> <view class="content-two_one" v-if="item.mer_status==0">
<view class="content-two-edita"> <view class="content-two-edita">
待处理 待处理
</view> </view>
@ -38,7 +38,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="content-two_oneq" v-if="item.type==2"> <view class="content-two_oneq" v-if="item.mer_status==1">
<view class="content-two-editb" @click="accepted"> <view class="content-two-editb" @click="accepted">
已接受 已接受
</view> </view>
@ -52,7 +52,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="content-two_one" v-if="item.type==3"> <view class="content-two_one" v-if="item.mer_status==2">
<view class="content-two-editc" @click="declined"> <view class="content-two-editc" @click="declined">
已拒绝 已拒绝
</view> </view>
@ -94,7 +94,6 @@
</view> </view>
<u-loadmore :status="status" v-if="orderList.length >= where.limit" /> <u-loadmore :status="status" v-if="orderList.length >= where.limit" />
<uni-popup ref="bindmobile" type="center" @click="close"> <uni-popup ref="bindmobile" type="center" @click="close">
<view class="" style="position: relative;"> <view class="" style="position: relative;">
<view class="entrust"> <view class="entrust">
<view class="entrust_close" @click="close"> <view class="entrust_close" @click="close">
@ -106,16 +105,16 @@
委托申请处理 委托申请处理
</view> </view>
<view class="bg-content-b"> <view class="bg-content-b">
结算周期: <span>30</span> 结算周期: <span>{{obj.settle_cycle}}</span>
</view> </view>
<view class="bg-content-c"> <view class="bg-content-c">
利息比例: <span>0.05%</span> 利息比例: <span>{{obj.interest_rate}}%</span>
</view> </view>
<view class="entrust_bga_btn"> <view class="entrust_bga_btn">
<view class="cancellation"> <view class="cancellation" @click="passDelete(obj)">
拒绝 拒绝
</view> </view>
<view class="determine"> <view class="determine" @click="passagree(obj)">
接受 接受
</view> </view>
</view> </view>
@ -218,11 +217,16 @@
<script> <script>
import cxNavTitle from '@/components/cx-navTitle.vue' import cxNavTitle from '@/components/cx-navTitle.vue'
import emptyPage from '@/components/emptyPage.vue'; import emptyPage from '@/components/emptyPage.vue';
import {} from '@/api/sale.js' import {
entrustlist,
finishchain,
checkchain
} from '@/api/sale.js'
export default { export default {
components: { components: {
cxNavTitle, cxNavTitle,
emptyPage emptyPage,
}, },
data() { data() {
return { return {
@ -232,22 +236,24 @@
orderList: [], orderList: [],
where: { where: {
page: 1, page: 1,
limit: 10 limit: 10,
type: 1,
status: 0
}, },
tabs: [{ tabs: [{
name: "tabOne", name: "tabOne",
label: '待处理', label: '待处理',
type: '1' type: 0
}, },
{ {
name: "tabTwo", name: "tabTwo",
label: '已接受', label: '已接受',
type: '2' type: 1
}, },
{ {
name: "tabThree", name: "tabThree",
label: '已拒绝', label: '已拒绝',
type: '3' type: 2
}, },
], ],
@ -275,7 +281,8 @@
type: 4 type: 4
} }
] ],
obj: {}
} }
}, },
onLoad() { onLoad() {
@ -285,7 +292,7 @@
}, },
mounted() { mounted() {
this.commislist()
}, },
methods: { methods: {
onReachBottom() { onReachBottom() {
@ -301,27 +308,18 @@
}, },
// //
commislist() { commislist() {
// console.log('111111') entrustlist(this.where).then((res) => {
this.orderList = res.data.list
})
}, },
// //
tabClick(e) { // tabClick(e) { //
this.activeItem = e.name; //class this.activeItem = e.name; //class
this.tabTitle = e.name; // this.tabTitle = e.name; //
this.where.page = 1
if (this.tabTitle = "tabOne") { this.where.status = e.type
this.where.page = 1 this.commislist()
this.orderList = []
this.commislist()
} else if (this.tabTitle = "tabTwo") {
this.where.page = 1
this.orderList = []
this.commislist()
} else {
this.where.page = 1
this.orderList = []
this.commislist()
}
}, },
// //
addDelegation() { addDelegation() {
@ -344,8 +342,9 @@
}) })
}, },
// //
soldEdit() { soldEdit(item) {
this.obj = item
console.log(item)
this.$refs.bindmobile.open() this.$refs.bindmobile.open()
}, },
// //
@ -372,11 +371,32 @@
}, },
// //
passDelete() { passDelete() {
checkchain(item.entrust_mer_id, {
status: 2
}).then((res) => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle ="tabOne"
this.commislist()
})
}, },
// //
passagree() { passagree(item) {
checkchain(item.entrust_mer_id, {
status: 1
}).then((res) => {
this.$util.Tips({
title: res.message,
icon: 'success'
})
this.orderList = []
this.tabTitle ="tabOne"
this.commislist()
this.$refs.bindmobile.close()
})
} }
} }
} }

View File

@ -21,7 +21,7 @@
</view> </view>
<zbpSwiper ref="list" :isSelectPlace="true" :town="street" :show="show" :location_Arr="locationArr" <zbpSwiper ref="list" :isSelectPlace="true" :town="street" :show="show" :location_Arr="locationArr"
@kkchange="kkchange" @change="dchange"> @change="dchange">
</zbpSwiper> </zbpSwiper>
<view class="tabs_wrapper"> <view class="tabs_wrapper">
@ -30,7 +30,10 @@
</view> </view>
<view class=""> </view> <view class=""> </view>
<view class="goodslist"> <view class="goodslist">
<WaterfallsFlow :wfList="cateGoods" /> <WaterfallsFlow :wfList="productList" @itemTap='itemTap' :type="1" />
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
</view> </view>
<view class="empty_wrapper" v-if="emptyShow"> <view class="empty_wrapper" v-if="emptyShow">
<u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty> <u-empty :show="emptyShow" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png"></u-empty>
@ -39,7 +42,7 @@
<u-picker :defaultIndex="[0, 0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm" <u-picker :defaultIndex="[0, 0]" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker> @cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
<u-loadmore :status="status" v-if="cateGoods.length >= where.limit" />
<!-- <view class="bg_color"></view> --> <!-- <view class="bg_color"></view> -->
<!--<m-tabbar native> <!--<m-tabbar native>
@ -52,6 +55,8 @@
</view> </view>
</template> </template>
</m-tabbar> --> </m-tabbar> -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"
:isGoIndex="false"></authorize>
<view class="location" v-if="isshow"> <view class="location" v-if="isshow">
<view class="locationa"> 位置权限使用说明 </view> <view class="locationa"> 位置权限使用说明 </view>
<view class="locationb"> 用于向你推荐最近门店 </view> <view class="locationb"> 用于向你推荐最近门店 </view>
@ -64,7 +69,10 @@
import zbpSwiper from '@/components/zbpSwiper' import zbpSwiper from '@/components/zbpSwiper'
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'; import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue' import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlows.vue'
import authorize from '@/components/Authorize';
import {
getUserInfo
} from '@/api/user.js';
import { import {
getSlideAPI getSlideAPI
} from '@/api/lihai.js' } from '@/api/lihai.js'
@ -95,19 +103,21 @@
mTabbar, mTabbar,
zbpSwiper, zbpSwiper,
easyLoadimage, easyLoadimage,
WaterfallsFlow WaterfallsFlow,
authorize
}, },
data() { data() {
return { return {
isNewRenderDone: false, //
isAuto: false, //
isShowAuth: false, //
activeStyle: { activeStyle: {
color: '#333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
transform: 'scale(1.04)' transform: 'scale(1.04)'
}, },
isshow: false, isshow: false,
locationArr: ({}), locationArr: ({}),
status: 'loadmore',
bgColor: '', bgColor: '',
showPicker: false, showPicker: false,
columnData: [], columnData: [],
@ -123,14 +133,17 @@
where: { where: {
category_id: 0, category_id: 0,
page: 1, page: 1,
limit: 6 limit: 10
}, },
loadend: false,
loading: false,
loadTitle: '加载更多',
currentItemId: 69, // 0 || 69 currentItemId: 69, // 0 || 69
keyword: '', keyword: '',
location: '', location: '',
emptyShow: false, emptyShow: false,
street: '', street: '',
cateGoods: [], productList: [],
recoList: [], recoList: [],
articleList: [], articleList: [],
streeta_id: '', streeta_id: '',
@ -139,13 +152,14 @@
backColor: 'rgba(252, 252, 252, 0)', backColor: 'rgba(252, 252, 252, 0)',
isFshow: false, isFshow: false,
scrollTop: 0, scrollTop: 0,
show: true show: true,
userid: ''
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getCateList() this.getCateList()
this.cateGoods = [] this.productList = []
this.getGoods() this.getGoods()
this.Area() this.Area()
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
@ -186,12 +200,7 @@
} }
}, },
onReachBottom() {
if (this.status == 'nomore') return;
this.status = 'loading';
this.where.page = ++this.where.page;
this.getGoods()
},
mounted() { mounted() {
this.selfLocation() this.selfLocation()
// #ifdef H5 // #ifdef H5
@ -209,12 +218,17 @@
}, },
onReachBottom() { onReachBottom() {
if (this.status == 'nomore') return; if (this.productList.length > 0) {
this.status = 'loading'; this.getGoods(false);
this.where.page = ++this.where.page; } else {
this.getGoods() this.getGoods()
}
}, },
mounted() { mounted() {
this.getUserInfo()
this.selfLocation() this.selfLocation()
// #ifdef H5 // #ifdef H5
// //
@ -225,6 +239,7 @@
// //
this.street = newValue.split(',')[0] this.street = newValue.split(',')[0]
}); });
}, },
// #ifdef APP-PLUS // #ifdef APP-PLUS
onPageScroll(e) { onPageScroll(e) {
@ -269,7 +284,49 @@
this.$bus.$off('value-updated') this.$bus.$off('value-updated')
}, },
methods: { methods: {
//
onLoadFun(data) {
this.getUserInfo();
this.isShowAuth = false;
},
/**
* 获取个人用户信息
*/
getUserInfo() {
getUserInfo().then(res => {
this.userid = res.data.uid
});
},
//
itemTap(item) {
if (this.userid) {
if (item.video_link.length > 0) {
uni.navigateTo({
// #ifdef MP || H5
url: `/pages/short_video/nvueSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif
// #ifdef APP
url: `/pages/short_video/appSwiper/index?id=${item.community_id}&uid=${this.userid}&user=1`
// #endif
})
} else {
uni.navigateTo({
url: `/pages/plantGrass/plant_detail/index?id=${item.community_id}`
})
}
} else {
this.isAuto = true;
this.isShowAuth = true
}
},
//
authColse: function(e) {
this.isShowAuth = e
},
scrolling() { scrolling() {
// //
let scrollTop = let scrollTop =
@ -320,9 +377,6 @@
}, },
kkchange(e) {
this.bgColor = e
},
tabsChange1(item) { tabsChange1(item) {
@ -455,30 +509,29 @@
} }
}) })
}, },
getGoods: function(item) { getGoods: function(isPage) {
let that = this;
graphicLstApi(this.where).then(res => { if (that.loadend) return;
this.cateGoods.push(...res.data.list) if (that.loading) return;
if (res.data.list.length < this.where.limit) this.status = 'nomore' if (isPage === true) that.$set(that, 'productList', []);
that.loading = true;
if (this.where.page == 1 && res.data.list.length <= 0) this.emptyShow = true that.loadTitle = '';
graphicLstApi(that.where).then(res => {
// if (item) { let list = res.data.list;
let productList = that.$util.SplitArray(list, that.productList);
// if (item.index == 1 && this.cateGoods[0]) { let loadend = list.length < that.where.limit;
// uni.navigateTo({ that.loadend = loadend;
// // #ifdef MP || H5 that.loading = false;
// url: `/pages/short_video/nvueSwiper/index?id=${this.cateGoods[0].community_id}` that.loadTitle = loadend ? '已全部加载' : '加载更多';
// // #endif that.$set(that, 'productList', productList);
// // #ifdef APP // console.log(that.productList)
// url: `/pages/short_video/appSwiper/index?id=${this.cateGoods[0].community_id}` that.$set(that.where, 'page', that.where.page + 1);
// // #endif if (that.where.page == 1 && res.data.list.length <= 0) that.emptyShow = true
// }) }).catch(err => {
// } that.loading = false;
// } that.loadTitle = '加载更多';
});
})
}, },
/*获取分类列表*/ /*获取分类列表*/
async getCateList() { async getCateList() {
@ -491,12 +544,12 @@
}, ...data] }, ...data]
}, },
tabsChange(item) { tabsChange(item) {
this.cateGoods = [] this.productList = []
this.where.category_id = item.category_id this.where.category_id = item.category_id
this.emptyShow = false this.emptyShow = false
this.status = 'loadmore' this.loadend = false;
this.where.page = 1 this.$set(this.where, 'page', 1)
this.getGoods(item) this.getGoods(true)
this.street_id = item.id this.street_id = item.id
this.tabsData.tabsActive = item.index this.tabsData.tabsActive = item.index

File diff suppressed because one or more lines are too long

View File

@ -155,7 +155,7 @@
that.where.page = 1; that.where.page = 1;
that.shopList = []; that.shopList = [];
getOrderList(that.where, that.mer_id).then(res => { getOrderList(that.where, that.mer_id).then(res => {
console.log(res); // console.log(res);
that.shopList = res.data.list that.shopList = res.data.list
console.log(that.shopList); console.log(that.shopList);
}) })
@ -166,7 +166,7 @@
getOrderList(this.where, this.mer_id).then(res => { getOrderList(this.where, this.mer_id).then(res => {
// console.log(res); // console.log(res);
this.shopList = res.data.list this.shopList = res.data.list
console.log(this.shopList); // console.log(this.shopList);
}) })
}, },
importshop(order_id, product_id, unique) { importshop(order_id, product_id, unique) {