【首页】

1、接入装修
2、分享配置调整
pull/1/MERGE
YunaiV 2023-08-16 22:43:54 +08:00
parent 83d81031e3
commit 5a25680bf7
7 changed files with 159 additions and 146 deletions

View File

@ -19,6 +19,8 @@ export function getCouponTemplateList(spuId, useType) {
return request.get("app-api/promotion/coupon-template/list", { return request.get("app-api/promotion/coupon-template/list", {
spuId, spuId,
useType useType
}, {
noAuth: true // TODO 芋艿:后续要做调整
}); });
} }

View File

@ -0,0 +1,9 @@
import request from "@/utils/request.js";
export function getDecorateComponentListByPage(page) {
return request.get("app-api/promotion/decorate/list", {
page
}, {
noAuth: true // TODO 芋艿:后续要做调整
});
}

View File

@ -53,3 +53,9 @@ export function getOrderItem(id) {
export function createOrderItemComment(data) { export function createOrderItemComment(data) {
return request.post("app-api/trade/order/item/create-comment", data); return request.post("app-api/trade/order/item/create-comment", data);
} }
export function getOrderExpressTrackList(id) {
return request.get("app-api/trade/order/get-express-track-list", {
id
});
}

View File

@ -1,6 +1,6 @@
// let domain = 'http://apif.java.crmeb.net' let domain = 'http://apif.java.crmeb.net'
let domain = 'http://127.0.0.1:48080' // let domain = 'http://127.0.0.1:48080'
module.exports = { module.exports = {
// 请求域名 格式: https://您的域名 // 请求域名 格式: https://您的域名

View File

@ -31,15 +31,15 @@
<!-- 首页展示 --> <!-- 首页展示 -->
<view class="page_content" :style="'margin-top:'+(marTop)+'px;'" v-if="navIndex === 0"> <view class="page_content" :style="'margin-top:'+(marTop)+'px;'" v-if="navIndex === 0">
<view class="mp-bg"></view> <view class="mp-bg"></view>
<!-- banner --> <!-- banner 轮播图 -->
<view class="swiper" v-if="imgUrls.length"> <view class="swiper" v-if="slideShows.length">
<swiper indicator-dots="true" :autoplay="true" :circular="circular" :interval="interval" <swiper indicator-dots="true" :autoplay="true" :circular="circular" :interval="interval"
:duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff"> :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
<block v-for="(item,index) in imgUrls" :key="index"> <block v-for="(item,index) in slideShows" :key="index">
<swiper-item> <swiper-item>
<navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper'
hover-class='none'> hover-class='none'>
<image :src="item.pic" class="slide-image" lazy-load></image> <image :src="item.picUrl" class="slide-image" lazy-load></image>
</navigator> </navigator>
</swiper-item> </swiper-item>
</block> </block>
@ -47,7 +47,7 @@
</view> </view>
<!-- 新闻简报 --> <!-- 新闻简报 -->
<view class='notice acea-row row-middle row-between' v-if="roll.length"> <view class='notice acea-row row-middle row-between' v-if="scrollingNews.length">
<view class="pic"> <view class="pic">
<image src="/static/images/xinjian.png" /> <image src="/static/images/xinjian.png" />
</view> </view>
@ -55,10 +55,10 @@
<view class='swipers'> <view class='swipers'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
vertical="true" circular="true"> vertical="true" circular="true">
<block v-for="(item,index) in roll" :key='index'> <block v-for="(item,index) in scrollingNews" :key='index'>
<swiper-item> <swiper-item>
<navigator class='item' :url='item.url' hover-class='none'> <navigator class='item' :url='item.url' hover-class='none'>
<view class='line1'>{{item.info}}</view> <view class='line1'>{{ item.name }}</view>
</navigator> </navigator>
</swiper-item> </swiper-item>
</block> </block>
@ -67,19 +67,19 @@
<view class="iconfont icon-xiangyou" /> <view class="iconfont icon-xiangyou" />
</view> </view>
<!-- menu --> <!-- menu 菜单 -->
<view class='nav acea-row' v-if="menus.length"> <view class='nav acea-row' v-if="menus.length">
<block v-for="(item,index) in menus" :key="index"> <block v-for="(item,index) in menus" :key="index">
<navigator class='item' v-if="item.show === '1'" :url='item.url' open-type='switchTab' <navigator class='item' v-if="item.show === '1'" :url='item.url' open-type='switchTab'
hover-class='none'> hover-class='none'>
<view class='pictrue'> <view class='pictrue'>
<image :src='item.pic'></image> <image :src='item.picUrl'></image>
</view> </view>
<view class="menu-txt">{{item.name}}</view> <view class="menu-txt">{{item.name}}</view>
</navigator> </navigator>
<navigator class='item' v-else :url='item.url' hover-class='none'> <navigator class='item' v-else :url='item.url' hover-class='none'>
<view class='pictrue'> <view class='pictrue'>
<image :src='item.pic'></image> <image :src='item.picUrl'></image>
</view> </view>
<view class="menu-txt">{{item.name}}</view> <view class="menu-txt">{{item.name}}</view>
</navigator> </navigator>
@ -124,9 +124,9 @@
:scroll-left="tabsScrollLeft" @scroll="scroll"> :scroll-left="tabsScrollLeft" @scroll="scroll">
<view class="tab nav-bd" id="tab_list"> <view class="tab nav-bd" id="tab_list">
<view id="tab_item" :class="{ 'active': listActive === index}" class="item" <view id="tab_item" :class="{ 'active': listActive === index}" class="item"
v-for="(item, index) in explosiveMoney" :key="index" @click="ProductNavTab(item,index)"> v-for="(item, index) in productRecommends" :key="index" @click="ProductNavTab(item,index)">
<view class="txt">{{item.name}}</view> <view class="txt">{{item.name}}</view>
<view class="label">{{item.info}}</view> <view class="label">{{item.tag}}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -168,8 +168,6 @@
import Cache from '../../utils/cache'; import Cache from '../../utils/cache';
const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'; const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let app = getApp(); let app = getApp();
import { getIndexData } from '@/api/api.js';
import { getShare } from '@/api/public.js';
import a_seckill from './components/a_seckill'; import a_seckill from './components/a_seckill';
import b_combination from './components/b_combination'; import b_combination from './components/b_combination';
import c_bargain from './components/c_bargain'; import c_bargain from './components/c_bargain';
@ -184,9 +182,9 @@
import * as ProductSpuApi from '@/api/product/spu.js'; import * as ProductSpuApi from '@/api/product/spu.js';
import * as PromotionActivityApi from '@/api/promotion/activity.js'; import * as PromotionActivityApi from '@/api/promotion/activity.js';
import * as CouponApi from '@/api/promotion/coupon.js'; import * as CouponApi from '@/api/promotion/coupon.js';
import * as DecorateApi from '@/api/promotion/decorate.js';
import * as ProductUtil from '@/utils/product.js'; import * as ProductUtil from '@/utils/product.js';
import * as Util from '@/utils/util.js'; import * as Util from '@/utils/util.js';
const arrTemp = ["beforePay", "afterPay", "refundApply", "beforeRecharge", "createBargain", "pink"];
export default { export default {
computed: mapGetters(['isLogin', 'uid']), computed: mapGetters(['isLogin', 'uid']),
components: { components: {
@ -204,23 +202,25 @@
statusBarHeight: statusBarHeight, statusBarHeight: statusBarHeight,
navIndex: 0, navIndex: 0,
navTop: [], navTop: [],
logoUrl: "",
imgUrls: [],
menus: [],
indicatorDots: false,
circular: true,
autoplay: true,
interval: 3000,
duration: 500,
couponList: [],
marTop: 0, marTop: 0,
explosiveMoney: [], configApi: {}, //
roll: [], // tabsScrollLeft: 0, // tabs
site_name: '', //title
configApi: {}, //
tabsScrollLeft: 0, // tabs
scrollLeft: 0, scrollLeft: 0,
slideShows: [], //
circular: true,
interval: 3000,
duration: 500,
menus: [], //
scrollingNews: [], //
indicatorDots: false,
autoplay: true,
couponList: [], //
productRecommends: [], //
site_name: '首页', // title
logoUrl: "",
// ========== =========== // ========== ===========
goodScroll: true, // goodScroll: true, //
listActive: 0, // listActive: 0, //
@ -273,9 +273,8 @@
this.getIndexConfig(); this.getIndexConfig();
}, },
onShow() { onShow() {
let self = this
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: self.site_name title: this.site_name
}) })
}, },
methods: { methods: {
@ -310,34 +309,60 @@
// //
getIndexConfig: function() { getIndexConfig: function() {
let that = this; let that = this;
getIndexData().then(res => { DecorateApi.getDecorateComponentListByPage(1).then(res => {
// TODO
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '首页' title: '首页'
}) })
that.$set(that, "logoUrl", res.data.logoUrl); this.$set(this, "logoUrl", 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png');
that.$set(that, "site_name", '首页'); this.$set(this, "site_name", '首页');
that.$set(that, "imgUrls", res.data.banner); // #ifdef H5
that.$set(that, "menus", res.data.menus); this.$store.commit("SET_CHATURL", 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
that.$set(that, "roll", res.data.roll ? res.data.roll : []); Cache.set('chatUrl', 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
// #ifdef H5 // #endif
that.$store.commit("SET_CHATURL", res.data.yzfUrl);
Cache.set('chatUrl', res.data.yzfUrl); //
// #endif const slideShow = res.data.find(item => item.code === 'slide-show');
that.$set(that, "explosiveMoney", res.data.explosiveMoney); if (slideShow) {
that.goodType = parseInt(res.data.explosiveMoney[0].type) this.$set(this, "slideShows", JSON.parse(slideShow.value));
this.getGroomList(); }
this.shareApi(); //
this.getcouponList(); const menu = res.data.find(item => item.code === 'menu');
if (menu) {
this.$set(this, "menus", JSON.parse(menu.value));
}
//
const scrollingNews = res.data.find(item => item.code === 'scrolling-news');
if (scrollingNews) {
this.$set(this, "scrollingNews", JSON.parse(scrollingNews.value));
}
//
const productRecommend = res.data.find(item => item.code === 'product-recommend');
if (productRecommend) {
this.$set(this, "productRecommends", JSON.parse(productRecommend.value));
if (this.productRecommends.length > 0) {
this.goodType = this.productRecommends[0].type
this.getGroomList();
}
}
}) })
//
this.shareApi();
//
this.getcouponList();
}, },
shareApi: function() { shareApi: function() {
getShare().then(res => { // TODO
this.$set(this, 'configApi', res.data); const configApi = {
// #ifdef H5 "title": "芋道商城",
this.setOpenShare(res.data); "synopsis": "芋道商城,好用!",
// #endif "img": "https://api.java.crmeb.net/crmebimage/public/operation/2021/09/23/61fc3e4a49844fa69c12812ce5d57641bfkfzjqh1q.png"
}) }
this.$set(this, 'configApi', configApi);
// #ifdef H5
this.setOpenShare(configApi);
// #endif
}, },
// //
setOpenShare: function(data) { setOpenShare: function(data) {
@ -349,8 +374,7 @@
link: location.href, link: location.href,
imgUrl: data.img imgUrl: data.img
}; };
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
configAppMessage);
} }
}, },
@ -389,7 +413,7 @@
*/ */
ProductNavTab(item, index) { ProductNavTab(item, index) {
this.listActive = index this.listActive = index
this.goodType = parseInt(item.type) this.goodType = item.type
this.listActive = index this.listActive = index
this.tempArr = [] this.tempArr = []
this.params.page = 1 this.params.page = 1
@ -407,13 +431,8 @@
this.iSshowH = true this.iSshowH = true
} }
this.loading = true this.loading = true
const type = this.goodType === 1 ? 'best' :
this.goodType === 2 ? 'hot' :
this.goodType === 3 ? 'new' :
this.goodType === 4 ? 'benefit':
this.goodType === 5 ? 'good': ''
ProductSpuApi.getSpuPage({ ProductSpuApi.getSpuPage({
recommendType: type, recommendType: this.goodType,
pageNo: this.params.page, pageNo: this.params.page,
pageSize: this.params.limit pageSize: this.params.limit
}).then(res => { }).then(res => {

View File

@ -271,8 +271,7 @@
<!-- #endif --> <!-- #endif -->
<!-- TODO 芋艿拼团 --> <!-- TODO 芋艿拼团 -->
<view class='bnt bg-color' v-if="orderInfo.combinationId > 0" @tap='goJoinPink'>查看拼团</view> <view class='bnt bg-color' v-if="orderInfo.combinationId > 0" @tap='goJoinPink'>查看拼团</view>
<!-- TODO 芋艿物流 --> <navigator class='bnt cancel' v-if="orderInfo.logisticsId > 0"
<navigator class='bnt cancel' v-if="orderInfo.deliveryType === 2 && orderInfo.status > 0"
hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.orderId"> hover-class='none' :url="'/pages/users/goods_logistics/index?orderId='+ orderInfo.orderId">
查看物流 查看物流
</navigator> </navigator>
@ -305,7 +304,6 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from '@/plugin/dayjs/dayjs.min.js'; import dayjs from '@/plugin/dayjs/dayjs.min.js';
import * as Util from '@/utils/util.js'; import * as Util from '@/utils/util.js';
import {receiveOrder} from "../../api/trade/order";
export default { export default {
components: { components: {
payment, payment,

View File

@ -29,6 +29,8 @@
<view class='copy copy-data' :data-clipboard-text="orderInfo.deliveryId">复制单号</view> <view class='copy copy-data' :data-clipboard-text="orderInfo.deliveryId">复制单号</view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- 物流轨迹 -->
<view class='item' v-for="(item,index) in expressList" :key="index"> <view class='item' v-for="(item,index) in expressList" :key="index">
<view class='circular' :class='index === 0 ? "on":""'></view> <view class='circular' :class='index === 0 ? "on":""'></view>
<view class='text' :class='index===0 ? "on-font on":""'> <view class='text' :class='index===0 ? "on-font on":""'>
@ -37,38 +39,22 @@
</view> </view>
</view> </view>
</view> </view>
<recommend :hostProduct='hostProduct' v-if="hostProduct.length"></recommend> <recommend :hostProduct='hostProduct' v-if="hostProduct.length" />
</view> </view>
<!-- #ifdef MP -->
<!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
</view> </view>
</template> </template>
<script> <script>
import { import { express } from '@/api/order.js';
express import { getProductHot } from '@/api/store.js';
} from '@/api/order.js';
import {
getProductHot
} from '@/api/store.js';
import ClipboardJS from "@/plugin/clipboard/clipboard.js"; import ClipboardJS from "@/plugin/clipboard/clipboard.js";
import { import { toLogin } from '@/libs/login.js';
toLogin import { mapGetters } from "vuex";
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import recommend from '@/components/recommend'; import recommend from '@/components/recommend';
// #ifdef MP import * as OrderApi from '@/api/trade/order.js';
import authorize from '@/components/Authorize'; export default {
// #endif
export default {
components: { components: {
recommend, recommend,
// #ifdef MP
authorize
// #endif
}, },
data() { data() {
return { return {
@ -81,7 +67,7 @@
hostProduct: [], hostProduct: [],
loading: false, loading: false,
goodScroll: true, goodScroll: true,
params: { // params: { //
page: 1, page: 1,
limit: 10, limit: 10,
}, },
@ -90,8 +76,8 @@
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
watch:{ watch:{
isLogin:{ isLogin:{
handler:function(newV,oldV){ handler:function(newV, oldV) {
if(newV){ if (newV) {
this.getExpress(); this.getExpress();
this.get_host_product(); this.get_host_product();
} }
@ -100,70 +86,63 @@
} }
}, },
onLoad: function (options) { onLoad: function (options) {
if (!options.orderId) return this.$util.Tips({title:'缺少订单号'}); if (!this.isLogin) {
toLogin();
return
}
//
if (!options.orderId) {
return this.$util.Tips({title:'缺少订单号'});
}
this.orderId = options.orderId; this.orderId = options.orderId;
if (this.isLogin) { this.getExpress();
this.getExpress(); this.get_host_product();
this.get_host_product(); },
} else { onReady: function() {
toLogin(); // #ifdef H5
} this.$nextTick(function() {
}, const clipboard = new ClipboardJS(".copy-data");
onReady: function() { clipboard.on("success", () => {
// #ifdef H5 this.$util.Tips({
this.$nextTick(function() { title: '复制成功'
const clipboard = new ClipboardJS(".copy-data"); });
clipboard.on("success", () => { });
this.$util.Tips({ });
title: '复制成功' // #endif
}); },
});
});
// #endif
},
methods: { methods: {
/** copyOrderId: function() {
* 授权回调 uni.setClipboardData({ data: this.orderInfo.deliveryId });
*/ },
onLoadFun: function() { getExpress: function() {
this.getExpress(); OrderApi.express(this.orderId).then(res => {
this.get_host_product(); // that.$set(that,'product',res.data.order.info[0] || {});
}, // that.$set(that,'orderInfo',res.data.order);
copyOrderId:function(){ this.$set(this, 'expressList', res.data || []);
uni.setClipboardData({ data: this.orderInfo.deliveryId }); });
}, },
getExpress:function(){ get_host_product: function () {
let that=this; this.loading = true
express(that.orderId).then(function(res){ if (!this.goodScroll) {
let result = res.data.express|| {}; return
that.$set(that,'product',res.data.order.info[0] || {}); }
that.$set(that,'orderInfo',res.data.order); let that = this;
that.$set(that,'expressList',result.list || []); getProductHot(that.params.page,that.params.limit).then(function (res) {
}); that.loading = false
}, that.goodScroll = res.data.list.length >= that.params.limit
get_host_product: function () { that.params.page++
this.loading = true that.hostProduct = that.hostProduct.concat(res.data.list)
if (!this.goodScroll) return });
let that = this; },
getProductHot(that.params.page,that.params.limit).then(function (res) {
//this.iSshowH = false
that.loading = false
that.goodScroll = res.data.list.length >= that.params.limit
that.params.page++
that.hostProduct = that.hostProduct.concat(res.data.list)
});
},
}, },
// //
onReachBottom() { onReachBottom() {
if (this.params.page !== 1) {
if (this.params.page != 1) {
this.get_host_product(); this.get_host_product();
} }
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.logistics .header { .logistics .header {
padding: 23rpx 30rpx; padding: 23rpx 30rpx;