123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889 |
- <template>
- <view class="selected-services">
- <!-- 头部 -->
- <navbar :config="config" backColor="#666"></navbar>
- <view class="shopCard">
- <view class="shop-info">
- <image :src="shop.logo" mode=""></image>
- <view class="shopNamebox">
- <view class="phone-btn" @click="goPhone(shop.customer_service_phone)">售后电话</view>
- <view class="shopName">{{ shop.shop_name }}</view>
- <view class="shopName_rate">
- <rate :value="shop.averageCopy"></rate> {{ shop.average }}分
- </view>
- </view>
- </view>
- <template v-if="false">
- <view class="shop_item mt30" style="alignItems: flex-start;">
- <image src="/static/convenienceService/location2.png" mode=""></image>
- <view>{{shop.province_name+shop.city_name+shop.area_name+shop.address}}</view>
- </view>
- <view class="shop_item" style="alignItems: flex-start;">
- <text class="iconfont2"></text>
- <view>营业时间:{{ shop.business_hours }}{{ shop.time_quantum }}</view>
- </view>
- </template>
- <view class="searchBox">
- <image src="/static/convenienceService/search.png" mode=""></image>
- <input @click="searchClick" v-model="value" type="text" placeholder-style="color:#B3B3B3;fontSize:28rpx"
- placeholder="可搜索本店商品" />
- </view>
- </view>
- <!-- 限时秒杀 -->
- <view class="seckill" v-if="currSeckill && currSeckill.length > 0">
- <view class="seckill-flex">
- <view class="seckill-top" @click="goProductDetails('/pages/research/nearby/timeLimit?shopid='+shopId)">
- <view class="seckill-left"> 限时秒杀 </view>
- <view class="seckill-line" v-if="currTime"> </view>
- <view class="seckill-time" v-if="currTime">{{ currTime }}点场 剩余
- </view>
- <view class="time-item">
- <uni-countdown :backgroundColor="'none'" @timeup="overDown2" :color="'#fff'"
- :splitorColor="'#fff'" :show-day="time2[0] > 0" :day="time2[0]" :hour="time2[1]"
- :minute="time2[2]" :second="time2[3]"></uni-countdown>
- </view>
- </view>
- <view class="commodity" v-if="currSeckill && currSeckill.length > 0">
- <swiper :indicator-dots="false" :autoplay="false" :display-multiple-items="itemsDis2"
- @change="imgActiveFun2" style="height: 220rpx" circular="true">
- <!-- <swiper-item class="option-item" @click="
- goProductDetails(
- '/pages/product/goods/seckillGoods?id=' + item.id
- )
- " v-for="item in currSeckill" :key="item.id">
- <image v-if="item && item.cover" :src="item.cover" mode=""></image>
- <view class="number">
- <rich-text :nodes="$mUtil.priceBigSmall(item.min_price)"></rich-text>
- </view>
- </swiper-item> -->
- <swiper-item v-for="(item,key) in currSeckill" :key="key">
- <div class="fa-item">
- <view class="option-item" v-for="itemSon in item"
- @click="goProductDetails('/pages/product/goods/seckillGoods?id=' + itemSon.id)"
- :key="item.id">
- <image v-if="itemSon && itemSon.cover" :src="itemSon.cover" mode=""></image>
- <view class="number">
- <rich-text :nodes="$mUtil.priceBigSmall(itemSon.min_price)"></rich-text>
- </view>
- </view>
- </div>
- </swiper-item>
- </swiper>
- <!-- <view class="slide-box">
- <view class="dotBox" v-if="currSeckill.length > 1">
- <view class="dotBox_item" v-for="(v, i) in currSeckill" :key="i"
- :class="{ active_dotBox: activeBannerIndex2 == i }"></view>
- </view>
- </view> -->
- <view class="dotBox" v-if="currSeckill.length > 1">
- <view class="dotBox_item" v-for="(v, i) in currSeckill" :key="i"
- :class="{ active_dotBox: activeBannerIndex2 == i }"></view>
- </view>
- </view>
- <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
- </view>
- </view>
- <!-- 拼团购 -->
- <view class="group-work" v-if="groupList && groupList.length > 0">
- <view class="group-item">
- <view class="group-top" @click="goProductDetails('/pages/research/homepage/groupList?shopid='+shopId)">
- <view class="group-left"> 拼团购 </view>
- <view class="group-right">
- 查看更多<text class="iconfont u-font24 u-999"></text>
- </view>
- </view>
- <view v-if="groupList && groupList.length > 0">
- <view class="work-item" v-for="(item, index) in groupList" :key="index" @click="
- goProductDetails('/pages/product/goods/puzzleGoods?id=' + item.id)
- ">
- <view class="work-left">
- <image :src="item.cover" class="work-image" mode=""></image>
- </view>
- <view class="work-title">
- <view class="u-text2 u-mt10">
- {{ item.title }}
- </view>
- <view class="go-group-work">
- <view class="work-number">
- <view class="num">
- <view class="large">
- <rich-text :nodes="$mUtil.priceBigSmall(item.min_price)"></rich-text>
- </view>
- <view class="small">
- <text class="pintuanc6">¥ {{ item.min_sale_price }}</text>
- </view>
- </view>
- <view class="how-many-people">
- {{ item.group_people_num }}人团,已拼<text class="number">{{
- item.result_sale_num
- }}</text>件
- </view>
- </view>
- <view class="go-btn">去拼团</view>
- </view>
- </view>
- </view>
- </view>
- <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
- </view>
- </view>
- <!-- 拼团购 -->
- <!-- 精品服务 -->
- <view class="boutique">
- <view class="item" :class="{ itemswitch: isActive == index }" v-for="(item, index) in service"
- :key="item.id" @click="switchAssembly(index)">
- {{ item.name }}
- </view>
- </view>
- <!-- <view class="transformation" :is="currentView"> </view> -->
- <!-- <service v-if="isActive==0" :cate='serviceCate' :good='serviceGood' @typeChange='serviceTypeChange'></service> -->
- <commodity :cate="commCate" :good="commGood" :isActive='isActive' @typeChange="commTypeChange"></commodity>
- </view>
- </template>
- <script>
- import commodity from "../../../components/selected/commodity.vue";
- import rate from "@/components/rate.vue"
- export default {
- components: {
- commodity,
- rate
- },
- data() {
- return {
- service: [
- // {
- // id: 1,
- // name: "精品服务",
- // },
- {
- id: 2,
- name: "精选商品",
- },
- ],
- isActive: 0,
- config: {
- back: true, //false是tolbar页面 是则不写
- title: "店铺信息",
- color: "#1a1a1a",
- //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
- backgroundColor: [1, "#fff"],
- },
- username: 123,
- scrollTop: 0,
- old: {
- scrollTop: 0,
- },
- shop: {}, //店铺信息
- currTime: null, //秒杀当前场
- currSeckill: [], //秒杀列表
- ml2: -22, //小红点偏移
- itemsDis2: 1, //当前小红点位置
- keyList2: 0, //一共几个点
- time2: [0, 0, 0, 0], //秒杀倒计时
- groupList: [],
- activeBannerIndex2: 0,
- shopId: null,
- commCate: [], //商品分类
- commGood: [], //商品列表
- commParams: {
- limit: 100000,
- },
- value: ""
- };
- },
- onLoad(options) {
- if (options.shopId) {
- this.shopId = options.shopId;
- this.getCommCate(options.shopId);
- this.getIndexList(options.shopId);
- this.seckillList(options.shopId);
- this.getgroupList(options.shopId);
- this.getCommGood(this.shopId);
- }
- },
- methods: {
- searchClick() {
- uni.navigateTo({
- url: "/pages/research/homepage/search",
- });
- },
- callPhone() {
- uni.makePhoneCall({
- phoneNumber: this.shop.customer_service_phone
- });
- },
- switchAssembly(index) {
- this.isActive = index;
- delete this.commParams.group_id;
- delete this.commParams.type;
- this.getCommCate(this.shopId);
- this.getCommGood(this.shopId);
- },
- commTypeChange(e) {
- if (e.type == undefined) {
- delete this.commParams.type;
- this.commParams.group_id = e.groupId;
- console.log(e)
- console.log('参数')
- } else {
- delete this.commParams.group_id;
- this.commParams.type = e.type;
- }
- this.getCommGood(this.shopId);
- },
- /**商品列表 */
- getCommGood(shopId) {
- this.$http
- .get(this.isActive == 0 ? `/service/goods/list/${shopId}` : `/goods/list/${shopId}`, this.commParams,
- false)
- .then((res) => {
- if (res && res.code == 200) {
- this.commGood = res.list;
- }
- });
- },
- /**商品分类 */
- getCommCate(shopId) {
- this.$http
- .get(this.isActive == 0 ? `/servicegoods/group/all/${shopId}` : `/goods_group/all/${shopId}`, {},
- false)
- .then((res) => {
- if (res && res.code == 200) {
- this.commCate = res.list;
- }
- });
- },
- imgActiveFun2(e) {
- this.activeBannerIndex2 = e.detail.current;
- },
- goProductDetails(url) {
- uni.navigateTo({
- url: url,
- });
- },
- /**限时秒杀 */
- seckillList(shopId) {
- this.$http
- .get(
- `/marketing/seckillActivityGoods/flash-sale?shop_id=${shopId}`, {
- limit: 10,
- page: 1
- },
- false
- )
- .then((res) => {
- if (res && res.code == 200) {
- this.currTime = res.data.start_hour;
- this.currSeckill = this.oneArrToTwoArr(res.data.list)
- // if (this.currSeckill && res.data.list.length <= 4) {
- // this.keyList2 = 1;
- // this.itemsDis2 = res.data.list.length;
- // }
- // if (
- // this.currSeckill &&
- // res.data.list.length > 4 &&
- // res.data.list.length <= 8
- // ) {
- // this.keyList2 = 2;
- // this.ml2 = -45;
- // this.itemsDis2 = 3;
- // }
- // if (
- // this.currSeckill &&
- // res.data.list.length > 8 &&
- // res.data.list.length <= 12
- // ) {
- // this.keyList2 = 3;
- // this.ml2 = -68;
- // this.itemsDis2 = 3;
- // }
- // if (
- // this.currSeckill &&
- // res.data.list.length > 12 &&
- // res.data.list.length <= 16
- // ) {
- // this.keyList2 = 4;
- // this.ml2 = -90;
- // this.itemsDis2 = 3;
- // }
- if (res.data.finish_time) {
- this.time2 = this.$mUtil
- .countDown(Math.floor(res.data.finish_time / 1000))
- .split(":")
- .map((val) => Number(val));
- }
- }
- });
- },
- oneArrToTwoArr(data) {
- let newData = [];
- let zyf = 4; //一维数组转二维数组长度(此处是二维数组每一个长度控制)
- for (var i = 0; i < Math.ceil(data.length / zyf); i++) {
- newData[i] = [];
- newData[i].push(data[i * zyf]);
- for (var j = 1; j < zyf; j++) {
- if (data[i * zyf + j] == undefined) {
- //超出长度控住
- return newData;
- } else {
- newData[i].push(data[i * zyf + j]);
- }
- }
- }
- return newData;
- },
- /**团购 */
- getgroupList(shopId) {
- this.$http
- .get(
- `/groupbuy/activitygoods/will-you-spell?shop_id=${shopId}`, {
- limit: 10,
- page: 1
- },
- false
- )
- .then((res) => {
- if (res && res.code == 200) {
- this.groupList = res.list;
- }
- });
- },
- /**查看地图 */
- openMap(shop) {
- uni.openLocation({
- latitude: Number(shop.tx_latitude),
- longitude: Number(shop.tx_longitude),
- name: shop.name,
- address: shop.address,
- success: function() {
- console.log("success");
- },
- });
- },
- /**获取店铺基本信息 */
- getIndexList(shopid) {
- this.$http.get("/yxt/shop/info/" + shopid).then((res) => {
- uni.stopPullDownRefresh();
- this.loading = false;
- if (res.data && res.code == 200) {
- this.shop = res.data;
- this.shop.averageCopy = Math.round(res.data.average)
- }
- });
- },
- scroll: function(e) {
- // console.log(e)
- this.old.scrollTop = e.detail.scrollTop;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .itemswitch {
- border-bottom: 4px solid #FA6138;
- color: #FA6138;
- font-weight: 700;
- }
- .boutique {
- display: flex;
- justify-content: space-around;
- margin: 0 30rpx;
- background-color: #fff;
- font-weight: 500;
- line-height: 30rpx;
- // color: #FA6138;
- .item {
- padding: 50rpx 0 20rpx 0;
- margin-bottom: 26rpx;
- }
- }
- // .work-title:last-child{
- // border: none;
- // }
- .work-item {
- padding: 0 20rpx;
- display: flex;
- position: relative;
- .work-title {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- padding-top: 59rpx;
- padding-left: 25rpx;
- font-size: 28rpx;
- font-weight: Regular;
- color: rgba(24, 24, 24, 1);
- flex: 1;
- .how-many-people {
- margin-top: 8rpx;
- height: 33rpx;
- opacity: 1;
- font-size: 24rpx;
- font-weight: 400;
- text-align: left;
- color: #333333;
- line-height: 24rpx;
- .number {
- color: red;
- font-weight: Regular;
- }
- }
- }
- .work-image {
- border-radius: 16rpx;
- width: 226rpx;
- height: 226rpx;
- background-color: red;
- margin-top: 50rpx;
- flex: 1;
- }
- .go-group-work {
- display: flex;
- align-items: flex-end;
- justify-content: space-between;
- .work-number {
- margin-top: 46rpx;
- font-weight: Bold;
- font-size: 20rpx;
- color: red;
- .num {
- display: flex;
- align-items: center;
- }
- .small {
- color: #cccccc;
- font-size: 22rpx;
- font-weight: 500;
- text-decoration: line-through;
- margin-left: 17rpx;
- }
- .work-red {
- font-size: 36rpx;
- font-weight: Bold;
- margin-left: 5rpx;
- }
- }
- .go-btn {
- background-color: #FA6138;
- color: #ffffff;
- padding: 11rpx 27rpx 11rpx 27rpx;
- border-radius: 32rpx;
- font-size: 28rpx;
- font-weight: 500;
- }
- }
- }
- .group-work {
- margin: 0 30rpx;
- .group-item {
- margin-bottom: 20rpx;
- background-color: #ffffff;
- margin-top: 50rpx;
- border-radius: 20rpx;
- .group-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 0 30rpx 0 30rpx;
- padding: 30rpx 0;
- border-bottom: 1rpx solid rgba(230, 230, 230, 1);
- .group-left {
- color: #000000;
- font-size: 36rpx;
- font-weight: Bold;
- }
- .group-right {
- font-size: 24rpx;
- font-weight: 400;
- color: rgba(51, 51, 51, 1);
- .iconfont {
- // font-size: 10rpx;
- color: #666666;
- margin-left: 10rpx;
- }
- }
- }
- }
- }
- .commodity {
- // display: flex;
- position: relative;
- // padding: 12rpx 20rpx;
- margin: 20rpx 0;
- /deep/ .uni-swiper-slide-frame {
- width: 26% !important;
- }
- .fa-item {
- display: flex;
- }
- .option-item:first-child {
- margin-left: 0;
- }
- .option-item {
- margin-left: 24rpx;
- image {
- width: 140rpx;
- height: 140rpx;
- }
- .number {
- margin-top: 4rpx;
- text-align: center;
- font-size: 36rpx;
- font-weight: Bold;
- line-height: 24rpx;
- color: #333333;
- width: 140rpx;
- text {
- font-size: 28rpx;
- font-weight: Medium;
- }
- }
- }
- }
- .dotBox {
- position: absolute;
- bottom: 0rpx;
- left: 50%;
- transform: translateX(-50%);
- height: 14rpx;
- overflow: hidden;
- border-radius: 14rpx;
- background-color: #ccc;
- display: flex;
- justify-content: center;
- .dotBox_item {
- width: 45rpx;
- height: 14rpx;
- border-radius: 2rpx;
- background-color: #ccc;
- transition: all 0.5s;
- }
- .active_dotBox {
- width: 45rpx;
- background: rgba(254, 70, 3, 1);
- transition: all 0.5s;
- }
- }
- .seckill {
- color: #fefefe;
- margin-top: 45rpx;
- margin: 45rpx 30rpx;
- .seckill-flex {
- overflow: hidden;
- // margin: auto;
- background-color: rgba(255, 255, 255, 1);
- border-radius: 20rpx;
- padding: 0 29rpx;
- .seckill-top {
- display: flex;
- align-items: center;
- margin: 0;
- padding: 30rpx 0;
- border-bottom: 1rpx solid #e6e6e6;
- .seckill-left {
- color: black;
- font-size: 36rpx;
- font-weight: 700;
- font-weight: Bold;
- padding-right: 16rpx;
- }
- .seckill-line {
- margin: 0 16rpx;
- width: 1rpx;
- height: 33rpx;
- background-color: #707070;
- }
- .seckill-time {
- font-size: 24rpx;
- font-weight: 400;
- color: #666;
- }
- .time-item {
- background: #FF0000;
- padding: 0 15rpx;
- font-size: 24rpx;
- margin-left: 30rpx;
- border-radius: 17rpx;
- font-weight: 700;
- }
- }
- }
- }
- .shop {
- position: relative;
- box-shadow: 1rpx 1rpx 1rpx #f7f7f7;
- margin: -105rpx 30rpx 0 30rpx;
- background-color: white;
- border-radius: 25rpx;
- z-index: 10;
- .map {
- display: flex;
- padding: 0 20rpx;
- margin-top: 24rpx;
- font-weight: 400;
- font-size: 24rpx;
- font-weight: 400;
- .iconfont {
- color: #163c2a;
- margin-right: 12rpx;
- }
- .name {
- font-size: 24rpx;
- color: #333333;
- font-weight: 400;
- width: 440rpx;
- }
- .see {
- color: #fe9000;
- margin-left: 20rpx;
- }
- }
- .do-business {
- display: flex;
- align-items: center;
- font-style: 24rpx;
- font-weight: 400;
- color: #333333;
- margin-top: 26rpx;
- padding: 0 20rpx 34rpx 20rpx;
- .iconfont {
- color: #163c2a;
- margin-right: 12rpx;
- }
- }
- .item {
- display: flex;
- .img {
- width: 200rpx;
- height: 200rpx;
- background-color: #fff;
- margin-top: -75rpx;
- border-radius: 20rpx;
- margin-left: 15rpx;
- /* display: none; */
- }
- .item-right {
- margin-top: 30rpx;
- .name {
- font-size: 32rpx;
- color: #333333;
- font-weight: Bold;
- margin-left: 21rpx;
- font-size: 32rpx;
- }
- .comment {
- margin-top: 10rpx;
- padding-left: 16rpx;
- align-items: center;
- display: flex;
- .iconfont {
- color: #ff4e15;
- padding-left: 10rpx;
- }
- .five-stars {
- margin-left: 16rpx;
- font-size: 28rpx;
- font-weight: Medium;
- color: #ff4e15;
- }
- }
- }
- }
- }
- .searchBox {
- display: flex;
- padding: 10rpx 35rpx;
- border: 1rpx solid #CCCCCC;
- border-radius: 36rpx;
- margin: 30rpx 0 0;
- display: flex;
- align-items: center;
- margin-top: 10rpx;
- background: #fff;
- image {
- width: 35rpx;
- height: 35rpx;
- margin-right: 15rpx;
- flex-shrink: 0;
- }
- input {
- text-align: left;
- }
- }
- .shopCard {
- // margin: 100rpx auto 0;
- width: 720rpx;
- // min-height: 320rpx;
- padding: 30rpx;
- // background: url('/static/convenienceService/cardBg.png')0 0 no-repeat;
- // background-size: 720rpx 320rpx;
- box-shadow: 0rpx 4rpx 8rpx 0rpx #f1f1f1;
- background: #ffffff;
- border-radius: 20rpx;
- position: relative;
- .shop-info {
- display: flex;
- align-items: center;
- >image {
- // position: absolute;
- // top: -70rpx;
- // left: 30rpx;
- width: 120rpx;
- height: 120rpx;
- border-radius: 20rpx;
- background: #fff;
- flex-shrink: 0;
- }
- }
- .shopNamebox {
- flex: 1;
- margin-left: 20rpx;
- position: relative;
- .phone-btn {
- width: 150rpx;
- margin-left: auto;
- padding: 6rpx 10rpx;
- text-align: center;
- color: #666;
- border-radius: 8rpx;
- background-color: #fff;
- border: 1rpx solid #666;
- position: absolute;
- right: 0;
- bottom: 0;
- }
- .shopName {
- font-size: 32rpx;
- color: #333333;
- font-weight: 700;
- // margin-top: 30rpx;
- }
- .shopName_rate {
- font-size: 28rpx;
- color: #333333;
- display: flex;
- margin-top: 15rpx;
- }
- }
- .shop_item {
- font-size: 24rpx;
- color: #333333;
- display: flex;
- align-items: center;
- margin-top: 22rpx;
- padding: 0 10rpx;
- text {
- color: #108948;
- font-size: 34rpx;
- }
- view {
- margin-left: 20rpx;
- }
- image {
- width: 34rpx;
- height: 37rpx;
- flex-shrink: 0;
- }
- .blueicon {
- color: #FA6138;
- }
- }
- }
- </style>
|