You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

998 lines
23 KiB

3 years ago
<template>
<view class="page">
<view class="bill">
3 years ago
<swiper class="swiper" autoplay="1500" :indicator-dots="true" :circular='true'
indicator-active-color="#ffffff" indicator-color="#cccccc">
<swiper-item class="swiper-wrap" v-for="(item,index) in banners" :key='index'>
<image :src="item" mode="aspectFill"></image>
</swiper-item>
</swiper>
<!-- <image src="../../static/img/home/xiangqing.png"></image> -->
3 years ago
</view>
<view class="billtextbox">
<view class="billtext">
<view class="left">
3 years ago
<image src="@/static/img/xsqg.png"></image>
3 years ago
</view>
<view class="middel">
</view>
<view class="right">
3 years ago
<view class="right a">立享</view>
<view class="right b">美味</view>
</view>
<view class="surplus">
<image v-if="info.classify == 2" class="item-Logo" mode="aspectFill"
src="/static/img/home/storeLogo.png"></image>
<image v-if="info.classify == 1" class="item-Logo" mode="aspectFill"
src="/static/img/my/eleicon.png"></image>
<text>剩余{{info.endNum}}</text>
3 years ago
</view>
</view>
</view>
<view class="shop">
<view class="shoptop">
<view class="shoptext">
<view class="left" style="float: left;">
3 years ago
<image :src="info.img"></image>
3 years ago
</view>
<view class="right">
3 years ago
<view class="shop-name-box">
<image v-if="info.classify == 2" class="item-Logo" mode="aspectFill"
src="/static/img/home/storeLogo.png"></image>
<image v-if="info.classify == 1" class="item-Logo" mode="aspectFill"
src="/static/img/my/eleicon.png"></image>
<text>{{info.merchantName}}</text>
</view>
<view>活动结束时间{{info.endTime}}</view>
<!-- <view>门店地址</view> -->
3 years ago
</view>
</view>
</view>
<view class="line"></view>
<view class="bottom">
3 years ago
<view class="text"> 番茄会员满{{info.memberPrice}}{{info.memberMoney}}积分,非会员满{{info.price}}{{info.money}}积分 </view>
3 years ago
</view>
</view>
<view class="welfare">
<view class="content">
3 years ago
<view class="top">
<view class="top-left">
<image src="../../static/img/home/huangguan.png"></image>
3 years ago
<text>加入番茄会员</text>
3 years ago
</view>
3 years ago
<view class="button" @tap="goPageLogin('/pages/my/myVIP')">开通会员</view>
3 years ago
</view>
<view class="bottom">
3 years ago
<view class="bottomcontent">
3 years ago
<view class="circle"><image src="https://download.cyjyyjy.com/fq-logo.jpg"></image></view>
3 years ago
<view class="jieshao">
<view style="font-size: 28rpx;font-weight: 500;color: #000000;">
3 years ago
进入番茄饭团福利群</view>
<view style="font-size: 24rpx;font-weight: 500;color: #000000;">
3 years ago
添加客服微信进入番茄饭团福利群</view>
</view>
3 years ago
<view class="add" @click="fensiImage">添加</view>
3 years ago
</view>
</view>
</view>
</view>
<view class="footers">
<view @click="kefu" style="24px;24px">
3 years ago
<image src="@/static/img/home/kefuxin.png" mode="widthFix" style="width: 24px;height: 24px;">
3 years ago
</image>
</view>
<view class="payinfo" @click="btns">
<view>立即抢单</view>
</view>
<view class="payinfo" @click="copyStoreName" style="border-radius: 0px 32rpx 32rpx 0px;">
3 years ago
<view>复制店名</view>
</view>
</view>
3 years ago
<!-- <view class="procedure">订单返现流程规则</view> -->
<view class="handle-step-box">
<image src="https://download.cyjyyjy.com/handle-step.png" mode="widthFix"></image>
</view>
<!-- <view class="procedurepictrue">
3 years ago
<view class="item">
<image src="../../static/img/home/qianggou.png"></image>
<view>抢购订单</view>
</view>
<view class="item" >
<image src="../../static/img/home/waimai.png" style="margin-left: 20px;"></image>
<view>外卖平台下单</view>
</view>
<view class="item">
<image src="../../static/img/home/haoping.png"></image>
<view>好评上传</view>
</view>
<view class="item">
<image src="../../static/img/home/fanli.png"></image>
<view>返利到账</view>
</view>
3 years ago
</view> -->
3 years ago
</view>
</template>
<script>
import shmilyDragImage from '@/components/shmily-drag-image/shmily-drag-image.vue'
export default {
components: {
shmilyDragImage
},
data() {
return {
// 页面信息
info: {},
items: [{
title: "抢购订单",
},
{
title: "外卖平台下单",
},
{
title: "好评上传",
},
{
title: "返利到账",
},
],
banners: [],
imageList: [],
isJieDanUser: false,
activeSteps: -1,
orderId: '',
goodsId: '',
latitude: '',
longitude: '',
isMyOrder: false,
isLogin: false,
recommendList1: [{
iconImg: '../../static/img/home/qiangdan.png',
title: '立即抢单'
},
{
iconImg: '../../static/img/home/wmpt.png',
title: '外卖平台下单'
},
{
iconImg: '../../static/img/home/uoload.png',
title: '订单上传'
},
{
iconImg: '../../static/img/home/pinjian.png',
title: '评鉴上传'
}
],
recommendList: [{
iconImg: '../../static/img/home/star.png',
title: ''
},
{
iconImg: '../../static/img/home/peitu.png',
title: ''
},
{
iconImg: '../../static/img/home/wenzi.png',
title: ''
}
],
btnType: '立即抢单',
status: 1,
id: 0,
arr: [],
showModal: true
}
},
onLoad(e) {
3 years ago
console.log(this.$queue.getData('mobile') == undefined)
3 years ago
this.goodsId = e.goodsId;
this.latitude = e.latitude;
this.longitude = e.longitude;
let token = this.$queue.getData('token');
let userId = this.$queue.getData('userId');
3 years ago
this.member = this.$queue.getData('member');
3 years ago
// if (!token) {
// this.goLogin();
// }
// 订单审核提醒 202
// 最新活动通知 204
// 点评提醒 205
// 活动反馈推送提醒 209
let that = this;
that.$Request.getT('/common/type/202').then(res => { //订单审核提醒
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/common/type/204').then(res => { //最新活动通知
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
that.$Request.getT('/common/type/205').then(res => { //点评提醒
if (res.code == 0) {
if (res.data && res.data.value) {
that.arr.push(res.data.value)
}
}
})
},
onShow() {
3 years ago
if (this.goodsId != '') {
this.initHelpOrder(this.goodsId);
}
3 years ago
3 years ago
let userId = this.$queue.getData('userId');
3 years ago
// if (userId) {
// //订阅
// if(this.showModal) {
// this.openMsg()
// }
// }
},
methods: {
// 开启订阅消息
openMsg() {
var that = this
wx.getSetting({
withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
success(ret) {
// console.log(ret,'------------------')
// console.log(Object.keys(ret.subscriptionsSetting.itemSettings).length)
// if (JSON.stringify(ret.subscriptionsSetting.itemSettings).indexOf('accept')!=-1) {
if (ret.subscriptionsSetting.itemSettings) {
uni.setStorageSync('sendorderMsg', true)
uni.openSetting({ // 打开设置页
success(rea) {
console.log(rea.authSetting)
}
});
} else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
uni.setStorageSync('sendorderMsg', false)
uni.showModal({
title: '提示',
content: '为了更好的体验,请绑定消息推送',
confirmText: '确定',
cancelText: '取消',
success: function(res) {
if (res.confirm) {
uni.requestSubscribeMessage({
tmplIds: that.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
that.showModal = false
} else if (res.cancel) {
that.showModal = true
}
}
})
}
}
})
},
fensiImage() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
let fensiImage = this.$queue.getData('fensiImage');
//#ifndef H5
uni.navigateTo({
url: '/pages/public/webview?url=' + fensiImage
});
//#endif
//#ifdef H5
window.location.href = fensiImage;
//#endif
},
goShareUser() {
uni.navigateTo({
url: '/pages/my/shareFriends'
});
},
navigate(href, e) {
// #ifdef H5
window.location.href = href;
//#endif
//#ifdef APP-PLUS
setTimeout(function() {
plus.runtime.openURL(href);
}, 500);
// #endif
},
navigation(latitude, longitude, name) {
// #ifdef APP-PLUS
let url = "";
if (plus.os.name == "Android") { //判断是安卓端
plus.nativeUI.actionSheet({ //选择菜单
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "腾讯地图"
}, {
title: "百度地图"
}, {
title: "高德地图"
}]
}, function(e) {
switch (e.index) {
//下面是拼接url,不同系统以及不同地图都有不同的拼接字段
case 1:
//注意referer=xxx的xxx替换成你在腾讯地图开发平台申请的key
url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
break;
case 2:
url =
`baidumap://map/marker?location=${latitude},${longitude}&title=${name}&coord_type=gcj02&src=andr.baidu.openAPIdemo`;
break;
case 3:
url =
`androidamap://viewMap?sourceApplication=appname&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
break;
default:
break;
}
if (url != "") {
url = encodeURI(url);
//plus.runtime.openURL(url,function(e){})调起手机APP应用
plus.runtime.openURL(url, function(e) {
plus.nativeUI.alert("本机未安装指定的地图应用");
});
}
})
} else {
// iOS上获取本机是否安装了百度高德地图,需要在manifest里配置
// 在manifest.json文件app-plus->distribute->apple->urlschemewhitelist节点下添加
//(如urlschemewhitelist:["iosamap","baidumap"])
plus.nativeUI.actionSheet({
title: "选择地图应用",
cancel: "取消",
buttons: [{
title: "腾讯地图"
}, {
title: "百度地图"
}, {
title: "高德地图"
}]
}, function(e) {
switch (e.index) {
case 1:
url = `qqmap://map/geocoder?coord=${latitude},${longitude}&referer=xxx`;
break;
case 2:
url =
`baidumap://map/marker?location=${latitude},${longitude}&title=${name}&content=${name}&src=ios.baidu.openAPIdemo&coord_type=gcj02`;
break;
case 3:
url =
`iosamap://viewMap?sourceApplication=applicationName&poiname=${name}&lat=${latitude}&lon=${longitude}&dev=0`;
break;
default:
break;
}
if (url != "") {
url = encodeURI(url);
plus.runtime.openURL(url, function(e) {
plus.nativeUI.alert("本机未安装指定的地图应用");
});
}
})
}
// #endif
// #ifdef MP-WEIXIN
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
success: function() {
console.log('success');
}
});
// #endif
},
goShop() {
if (this.info.classify == 2) { //美团
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wx2c348cf579062e56',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
} else if (this.info.classify == 1) { //饿了么
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wxece3a9a4c82f58c9',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
}
},
initHelpOrder(goodsId) {
this.$queue.showLoading('加载中...');
let that = this;
let userId = this.$queue.getData('userId') ? this.$queue.getData('userId') : 0;
this.$Request.getT('/wm/selectGoodsDetails?goodsId=' + goodsId + '&userId=' + userId + '&latitude=' + this
.latitude + '&longitude=' + this.longitude).then(res => {
if (res.code == 0) {
let image = res.goods.img.split(",");
if (Date.parse(res.goods.endTime.replace('-', '/').replace('-', '/')) < Date.parse(
new Date())) {
console.log('这个已经过期了')
this.status = 99;
} else {
this.status = res.status;
}
this.banners = image;
if (res.orders) {
this.orderId = res.orders.orderId;
}
res.goods.distance = this.setMorKm(res.goods.distance);
this.info = res.goods;
uni.hideLoading();
} else {
this.$queue.showToast(res.msg);
setTimeout(d => {
uni.hideLoading();
uni.navigateBack();
}, 1000);
}
});
},
setMorKm(m) {
var n = ''
if (m) {
if (m >= 1000) {
n = (m / 1000).toFixed(0) + 'km'
} else {
n = parseInt(m) + 'm'
}
} else {
n = '0m'
}
return n
},
// 联系
kefu() {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.navigateTo({
3 years ago
url: '/pagesB/pages/my/customer'
3 years ago
});
},
// 立即下单 打开美团外卖
btns() {
3 years ago
if(this.$queue.getData('mobile') == undefined){
uni.navigateTo({
url: '/pages/public/mobile'
})
return
}
3 years ago
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
this.$queue.showLoading('抢单中...');
let userId = this.$queue.getData('userId');
this.$Request.postT('/wm/insertOrders?goodsId=' + this.goodsId + '&userId=' + userId).then(res => {
if (res.code == 0) {
this.$queue.showToast('抢单成功!');
this.initHelpOrder(this.goodsId);
setTimeout(d => {
if (this.info.classify == 2) { //美团
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wx2c348cf579062e56',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
3 years ago
//#ifdef H5
window.location.href = this.info.url;
//#endif
3 years ago
} else if (this.info.classify == 1) { //饿了么
// #ifdef MP-WEIXIN
uni.navigateToMiniProgram({
appId: 'wxece3a9a4c82f58c9',
path: this.info.url,
fail(res) {
console.error(res)
}
})
// #endif
3 years ago
//#ifdef H5
window.location.href = this.info.url;
//#endif
3 years ago
}
}, 500);
} else {
uni.hideLoading();
this.$queue.showToast(res.msg);
}
});
},
// 放弃任务
fangqi(id) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.showModal({
title: '温馨提示',
content: '您是否要放弃当前任务?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: d => {
var that = this;
if (d.confirm) {
console.log('用户点击确定');
that.$queue.showLoading('提交中...');
that.$Request.postT('/wm/abandonOrders?orderId=' + id).then(res => {
if (res.code === 0) {
that.$queue.showToast('已放弃当前任务!');
that.initHelpOrder(that.goodsId);
uni.hideLoading();
} else {
that.$queue.showToast(res.msg);
uni.hideLoading();
}
})
}
}
});
},
// 上传凭证
shangchuan(id) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.navigateTo({
url: '/pages/order/release?orderId=' + id
});
},
callContact(phone) {
if (uni.getStorageSync('sendorderMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
uni.makePhoneCall({
phoneNumber: phone
});
},
goLogin() {
this.$queue.setData('href', '/pages/index/taskDetail?helpOrderId=' + this.helpOrderId);
uni.navigateTo({
url: '/pages/public/login'
});
},
goPageLogin(url) {
let token = this.$queue.getData('token');
if (token) {
if (uni.getStorageSync('sendMyMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
console.log('是否有token')
uni.navigateTo({
url
})
} else {
this.goLogin();
}
},
copyStoreName(){
uni.setClipboardData({
data: this.info.goodsTitle,
success: function () {
console.log('success');
}
});
},
3 years ago
}
}
</script>
<style lang="scss">
page {
width: 100%;
margin: 0;
padding: 0;
background-color: #F6F6F6;
3 years ago
padding-bottom: 164rpx;
3 years ago
}
3 years ago
.bill{
3 years ago
width: 100%;
3 years ago
height: 426rpx;
.swiper{
width: 100%;
height: 426rpx;
image{
width: 100%;
display: block;
}
}
3 years ago
}
3 years ago
// .bill image {
// width: 100%;
// height: 208px;
// display: block;
// }
3 years ago
.billtextbox {
width: 100%;
height: 60px;
display: flex;
align-items: center;
background: linear-gradient(48deg, #FF5656 0%, #FF9F74 100%);
}
.billtext {
width: 100%;
3 years ago
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
3 years ago
}
.billtext .left {
width: 50%;
3 years ago
height: 120rpx;
3 years ago
color: #FAD19C;
3 years ago
image{
width: 100%;
height: 100%;
}
3 years ago
}
.middel {
width: 0px;
3 years ago
height: 62rpx;
3 years ago
border: 1px solid #FFFFFF;
3 years ago
margin: 0 22rpx 0 20rpx;
3 years ago
}
3 years ago
3 years ago
.billtext .right {
3 years ago
font-size: 30rpx;
3 years ago
font-weight: 400;
color: #FFFFFF;
}
3 years ago
.surplus{
display: flex;
align-items: center;
color: #FFFFFF;
font-size: 22rpx;
image{
width: 32rpx;
height: 32rpx;
margin-right: 6rpx;
}
}
3 years ago
.text2 {
float: left;
width: 50%;
}
.shop {
margin: 0 16px;
height: 152px;
margin-top: 20rpx;
background-color: #FFFFFF;
border-radius: 8px;
}
.shoptop {
height: 94px;
width: 90%;
margin: 0 auto;
}
.shoptext {
3 years ago
padding-top: 20rpx;
display: flex;
3 years ago
}
.shoptext image {
3 years ago
width: 130rpx;
height: 130rpx;
border-radius: 8rpx;
3 years ago
}
.shoptext .right {
margin-left: 10rpx;
3 years ago
font-size: 24rpx;
color: #2a2a2a;
3 years ago
.shop-name-box{
display: flex;
align-items: center;
margin-bottom: 10rpx;
3 years ago
font-size: 28rpx;
color: #000;
3 years ago
image{
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
}
}
3 years ago
}
.shop .bottom {
3 years ago
width: 100%;
height: 82rpx;
padding: 26rpx 30rpx;
3 years ago
display: flex;
3 years ago
3 years ago
}
3 years ago
3 years ago
.shop .bottom .text {
3 years ago
font-size: 28rpx;
3 years ago
font-weight: 500;
color: #FF4848;
}
.line {
width: 316px;
height: 1px;
border: 1px solid rgba(112, 112, 112, 0.10980392156862745);
margin: 0 auto;
}
.welfare {
3 years ago
margin: 32rpx;
3 years ago
}
3 years ago
.bottomcontent{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
3 years ago
.welfare .top {
3 years ago
width: 100%;
height: 96rpx;
background-color: #0C0C0C;
3 years ago
color: #FAD19C;
3 years ago
font-size: 28rpx;
border-top-right-radius: 16rpx;
border-top-left-radius: 16rpx;
3 years ago
display: flex;
align-items: center;
3 years ago
justify-content: space-between;
padding: 0 24rpx;
.top-left{
width: 70%;
display: flex;
align-items: center;
image{
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
}
3 years ago
}
.welfare .button {
3 years ago
// margin-left: 70px;
width: 200rpx;
height: 48rpx;
3 years ago
background: #FAD19C;
border-radius: 12px;
3 years ago
font-size: 28rpx;
3 years ago
color: #000000;
3 years ago
text-align: center;
line-height: 48rpx;
3 years ago
}
.content .bottom {
height: 100px;
display: flex;
3 years ago
justify-content: space-between;
3 years ago
background-color: #FFFFFF;
}
.bottom .circle {
3 years ago
width: 100rpx;
height: 100rpx;
3 years ago
border-radius: 50%;
margin-left: 10rpx;
3 years ago
line-height: 100rpx;
text-align: center;
overflow: hidden;
image{
width: 100rpx;
height: 100rpx;
display: inline;
border-radius: 50%;
}
3 years ago
}
.bottom .jieshao {
margin-top: 5px;
margin-left: 10px;
}
.bottom .add {
3 years ago
width: 96rpx;
height: 38rpx;
3 years ago
background: linear-gradient(141deg, #FF4848 0%, #FF2929 100%);
3 years ago
border-radius: 20rpx;
font-size: 24rpx;
3 years ago
font-weight: 500;
color: #FFFFFF;
3 years ago
line-height: 38rpx;
text-align: center;
3 years ago
}
// 底部按钮
.footers {
width: 100%;
3 years ago
height: 124rpx;
3 years ago
background: #FFFFFF;
position: fixed;
bottom: 0;
3 years ago
padding: 0 20rpx;
3 years ago
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
.payinfo {
width: 152px;
3 years ago
height: 64rpx;
3 years ago
background: linear-gradient(127deg, #FF8A6B 0%, #FF2929 100%);
opacity: 1;
border-radius: 17px 0px 0px 15px;
font-size: 12px;
font-weight: 500;
color: #FFFFFF;
line-height: 32px;
text-align: center;
}
.payinfo1 {
width: 25%;
display: inline-block;
}
.tui-button-primar {
width: 60%;
height: 78upx;
line-height: 78upx;
opacity: 1;
background: #ffc705;
border-radius: 16rpx;
}
}
.procedure {
3 years ago
font-size: 32rpx;
3 years ago
font-weight: 600;
color: #000000;
3 years ago
margin-top: 36rpx;
margin-bottom: 16rpx;
padding-left: 64rpx;
3 years ago
}
3 years ago
.handle-step-box{
width: 100%;
image{
width: 100%;
}
3 years ago
}
</style>