刘翔宇-旅管家 5 years ago
parent e0b8d7e468
commit 7ee4b810ff

@ -33,7 +33,7 @@
</view>
</view>
<view class="formCol">
<view>建卡医院<text style="color:red">*</text></view>
<view>建卡医院</view>
<view class="formRight">
<picker :value="hindex" @change="bindHospitalChange" :range="arrHospital">
<view class="uni-input">{{arrHospital[hindex]}}</view>
@ -57,6 +57,8 @@
</view>
</view> -->
</view>
<view class="payBtn" @click="pay"></view>
</view>
</template>
@ -137,18 +139,12 @@
this.alert('请输入具体街道/地址')
return
}
if (weixin.isNull(this.info.hospital) || this.hindex == 0) {
this.alert('请输入具体建卡医院')
return
}
weixin.request({
api: '/api/member/order-add',
method: 'POST',
data: this.info,
utilSuccess: r => {
console.log(r.data.total)
console.log(r.data.total)
utilSuccess: r => {
if (parseFloat(r.data.total) == 0) {
uni.navigateTo({
url: '../buyMemberSuccess/buyMemberSuccess?id=' +
@ -187,6 +183,7 @@
}
},
utilFail: r => {
weixin.alert(r)
console.log(r);
}
@ -221,6 +218,10 @@
}
</style>
<style lang="scss" scoped>
button::after {
border: none
}
.content {
display: flex;
flex-direction: column;

File diff suppressed because it is too large Load Diff

@ -6,12 +6,15 @@
<view class="memberCon">
<view class="topTit">
<text class="titInner">
<text class="titCon"><text class="f_blue"><text
class="f_big">{{packages.price}}</text></text>{{packages.name}}</text>
<text class="titCon"><text class="f_blue">
<block v-if="packages.price>0"><text class="f_big">{{packages.price}}</text></block>
<block v-else><text class="f_big">免费</text></block>
</text>{{packages.name}}</text>
<text class="line"></text>
</text>
</view>
<view class="title flex_center">
<view class="title flex_center" style="display: none;">
<view class="i_left">
<image src="../../../../static/i_left.png"></image>
</view>
@ -20,12 +23,14 @@
<image src="../../../../static/i_right.png"></image>
</view>
</view>
<view class="mealCol flex_start flex_wrap">
<view class="mealCol flex_start flex_wrap" style="display: none;">
<block v-for="(mod, i) in packages.items">
<view class="colInfo">
<view class="flex_between"><text class="colInfoText">{{mod.product_type.name}}</text><text
class="f_black">{{((mod.num!=""&&mod.num!=undefined)? mod.num:"1")}} {{((mod.unit!=""&&mod.unit!=undefined)? mod.unit:"次")}}</text></view>
<view class="flex_between" style="align-items: unset;"><text
class="colInfoText">{{mod.product_type.name}}</text><text
class="f_black">{{((mod.num!=""&&mod.num!=undefined)? mod.num:"1")}}{{((mod.unit!=""&&mod.unit!=undefined)? mod.unit:"次")}}</text>
</view>
</view>
</block>
</view>
@ -34,18 +39,40 @@
<view class="cardOuter">
<view :class="cardActive" @click="cardActive">
<view class="note">{{packages.content}}</view>
<view class="note">
<u-parse :domain="domain" :html="packages.content"></u-parse>
</view>
</view>
</view>
<button class="buyNow" @click="goBuy"></button>
</view>
</view>
<view class="shareIcon" @click="shareOpen" v-if="user_info.promotion == 1">
<image src="../../../../static/share.png"></image>
<view class="footer">
<view class="menuLink">
<navigator url="../../../../pages/home/home" open-type="switchTab">
<view class="menuCol">
<text class="iconfont icon-home"></text>
<text>首页</text>
</view>
</navigator>
<view class="menuCol" @click="shareOpen" v-if="user_info.promotion == 1">
<text class="iconfont icon-Share"></text>
<text>分享</text>
</view>
<button open-type="contact" class="menuCol" style="display: flex;
flex-direction: column;
line-height: inherit;
background: none;
padding: unset;">
<text class="iconfont icon-Icon_customerservice"></text>
<text>客服</text>
</button>
</view>
<view class="buyBtn" @click="goBuy"></view>
</view>
<uni-popup ref="shareCode" :mask-click="true" type="bottom" class="shareBox">
<view class="codeOuter">
<view class="shareCon" @click="shareClose">
@ -92,7 +119,9 @@
sharePath: "",
scare: 1,
shareHeight: 500,
id: ""
domain: "",
id: "",
promotion_id: ""
}
},
onLoad(option) {
@ -103,11 +132,21 @@
this.id = option.id;
this.getPackages();
}
const scene = decodeURIComponent(option.scene);
if (!weixin.isNull(scene)) {
console.log(scene)
this.id = weixin.getParam(scene, "id");
this.promotion_id = weixin.getParam(scene, "promotion_id");
uni.setStorageSync("base_promotion_id", this.promotion_id);
this.getPackages();
}
weixin.getOpenidInfo(info => {
this.user_info = info
}, false)
this.scare = windowWidth / 375;
console.log(weixin.getBaseUrl())
this.domain = weixin.getBaseUrl();
},
onShow() {
if (this.checkLogin()) {
@ -117,11 +156,12 @@
onShareAppMessage() {
return {
title: this.packages.name,
path: 'packages/packageBuy/pages/packageInfo/index?id='+this.id+'&promotion_id=' + this.user_info.id,
path: 'packages/packageBuy/pages/packageInfo/index?id=' + this.id + '&promotion_id=' + this.user_info.id,
imageUrl: this.img
}
},
methods: {
shareOpen() {
uni.showLoading({
title: '加载中'
@ -138,19 +178,18 @@
});
},
getAvatar: function() {
let userProfile = uni.getStorageSync('user_profile');
if(!weixin.isNull(userProfile)){
uni.getImageInfo({
src: userProfile.avatarUrl, //
success: rlogo => {
this.imgAvatar = rlogo.path;
this.draw();
}
});
}
else{
this.imgAvatar="../../../../static/avatar.jpg";
this.draw();
let userProfile = uni.getStorageSync('user_profile');
if (!weixin.isNull(userProfile)) {
uni.getImageInfo({
src: userProfile.avatarUrl, //
success: rlogo => {
this.imgAvatar = rlogo.path;
this.draw();
}
});
} else {
this.imgAvatar = "../../../../static/avatar.jpg";
this.draw();
}
},
draw: function() {
@ -161,7 +200,7 @@
method: 'GET',
data: {
path: 'packages/packageBuy/pages/packageInfo/index',
scene: 'id='+this.id+'&promotion_id=' + this.user_info.id
scene: 'id=' + this.id + '&promotion_id=' + this.user_info.id
},
success: r => {
if (r.data.status === 1) {
@ -290,8 +329,8 @@
if (this.checkLogin()) {
let package_id = this.id;
uni.navigateTo({
url:"../buyMember/buyMember?package_id=" + package_id
uni.navigateTo({
url: "../buyMember/buyMember?package_id=" + package_id
});
}
},
@ -340,7 +379,62 @@
padding-bottom: 160rpx;
}
</style>
<style lang="scss" scoped>
<style lang="scss" scoped>
button::after {
border: none
}
.footer {
width: 100%;
height: 112rpx;
background: #FFFFFF;
box-shadow: 0px -1rpx 0px 0px #DEDEDE;
padding: 0 30rpx;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
bottom: 0;
left: 0;
.menuLink {
display: flex;
justify-content: flex-start;
align-items: center;
color: #333;
.menuCol {
margin: 0 30rpx;
font-size: 20rpx;
text {
display: block;
}
.iconfont {
font-size: 36rpx;
margin-bottom: 6rpx;
}
}
}
.buyBtn {
width: 220rpx;
height: 72rpx;
background: linear-gradient(90deg, #FF7E95 0%, #FF447B 100%);
border-radius: 36rpx;
font-size: 28rpx;
font-weight: 500;
text-align: center;
line-height: 72rpx;
color: #fff;
}
}
.content {
display: flex;
flex-direction: column;
@ -605,7 +699,7 @@
}
}
.mealCol {
.mealCol {
padding: 0 20rpx;
.width_453 {

@ -29,11 +29,11 @@
<view class="shopInfo">
<view class="tit">
<image mode="heightFix" src="../../static/icon_dizhi.png"></image>
<text>苏州市姑苏区十全街999号</text>
<text>{{info.merchant.address}}</text>
</view>
<view class="add_detail">
<view class="add_l">距地铁1号线临顿路站4号口入口步行 500</view>
<view class="add_r">
<view class="add_l">暂无</view>
<view class="add_r" @click="">
<text class="iconfont icon-dianhua"></text>
<text>电话</text>
</view>
@ -50,6 +50,15 @@
</view>
</view>
</view>
<view class="details">
<view class="detail">
<view class="tit">商品详情</view>
<view class="txts">
<u-parse :html="info.content"></u-parse>
</view>
</view>
</view>
<!--为您推荐-->
<view class="introBox hasMenu">
<view class="normal_tit padding_20">附近商家</view>
@ -94,10 +103,13 @@
<text class="iconfont icon-Share"></text>
<text>分享</text>
</view>
<view class="menuCol">
<button open-type="contact" class="menuCol" style="display: flex;
flex-direction: column;
line-height: inherit;
background: none; padding: unset;">
<text class="iconfont icon-Icon_customerservice"></text>
<text>客服</text>
</view>
</button>
</view>
<view class="buyBtn" @click="toBuy"></view>
</view>
@ -150,7 +162,6 @@
let SCREEN_WIDTH = sysInfo.screenWidth
let SCREEN_HEIGHT = sysInfo.screenHeight;
let WindowHeight = sysInfo.windowHeight;
let windowWidth = sysInfo.windowWidth;
import {
weixin
@ -187,7 +198,8 @@
sharePath: "",
scare: 1,
shareHeight: 500,
imgAvatar: ""
imgAvatar: "",
poster: ""
}
},
onShareAppMessage() {
@ -207,6 +219,14 @@
this.openid = that.user_info.openid;
this.form.member_name = that.user_info.name;
this.form.phone = that.user_info.phone;
const scene = decodeURIComponent(options.scene);
if (!weixin.isNull(scene)) {
this.form.product_id = weixin.getParam(scene, "id");
this.id == weixin.getParam(scene, "id");
this.promotion_id = weixin.getParam(scene, "promotion_id");
uni.setStorageSync("base_promotion_id", this.promotion_id);
}
this.loadInfo();
this.loadPage();
this.form.product_id = options.id;
@ -214,8 +234,20 @@
if (options.promotion_id) {
uni.setStorageSync("base_promotion_id", options.promotion_id)
}
},
methods: {
getPoster: function() {
var that = this;
uni.getImageInfo({
src: that.info.poster_url, //
success: res => {
that.poster = res.path;
that.getAvatar();
}
});
},
getAvatar: function() {
let userProfile = uni.getStorageSync('user_profile');
@ -242,7 +274,7 @@
});
var that = this;
this.$refs.shareCode.open();
this.getAvatar();
this.getPoster();
},
draw: function() {
var that = this;
@ -277,7 +309,7 @@
0.15, (SCREEN_HEIGHT - SCREEN_WIDTH * 0.6 * 1.65) /
2, SCREEN_WIDTH * 0.695, SCREEN_WIDTH * 0.6 * 1.5); */
ctx.drawImage(this.info.poster, 20, 30 + 40,
ctx.drawImage(this.poster, 20, 30 + 40,
w -
40, (h - 60 - 60) * 0.5);
/* SCREEN_WIDTH * 0.15, (SCREEN_HEIGHT - SCREEN_WIDTH *
@ -288,7 +320,7 @@
//
ctx.fillStyle = "#fff";
// xy
ctx.fillText("福利专享", 20, 50);
ctx.fillText("优孕课堂福利专享", 20, 50);
ctx.font = "16rpx bold";
//
@ -578,6 +610,10 @@
}
</script>
<style lang="scss" scoped>
button::after {
border: none
}
.payBtn {
width: 90%;
height: 100rpx;

@ -25,8 +25,8 @@
<view class="infoList">
<view class="infoCol">
<view class="date">
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
{{item.created_at}}
<image mode="heightFix" src="../../static/icon_shijian@2x.png"></image>
{{$u.timeFormat(item.created_at, 'yyyy年mm月dd日')}}
</view>
<view class="price"><text>¥</text>{{item.total}}</view>
</view>

@ -61,7 +61,8 @@
}
this.sendReq('/api/member/registered-promotion', this.info, (r) => {
if (r.data.status === 1) {
if (r.data.status === 1) {
weixin.getOpenidInfo(function(){},true);
uni.navigateTo({
url: '../regSuccess/regSuccess'
})

@ -7,8 +7,13 @@
<view class="memberCon" :data-id="item.id" @click="toDetail">
<view class="topTit">
<text class="titInner">
<text class="titCon"><text class="f_blue"><text
class="f_big">{{item.price}}</text></text>{{item.name}}</text>
<text class="titCon">
<text class="f_blue">
<block v-if="item.price>0"><text class="f_big">{{item.price}}</text></block>
<block v-else><text class="f_big">免费</text></block>
</text>
{{item.name}}
</text>
<text class="line"></text>
</text>
</view>
@ -22,12 +27,13 @@
</view>
</view>
<view class="mealCol flex_start flex_wrap">
<block v-for="(mod, i) in item.items">
<view class="colInfo">
<view class="flex_between"><text class="colInfoText">{{mod.product_type.name}}</text><text
class="f_black">{{((mod.num!=""&&mod.num!=undefined)? mod.num:"1")}}
{{((mod.unit!=""&&mod.unit!=undefined)? mod.unit:"次")}}</text></view>
<view class="flex_between" style="align-items: unset;">
<text class="colInfoText">{{mod.product_type.name}}</text>
<text class="f_black">
{{((mod.num!=""&&mod.num!=undefined)? mod.num:"1")}}{{((mod.unit!=""&&mod.unit!=undefined)? mod.unit:"次")}}</text>
</view>
</view>
</block>
</view>
@ -48,7 +54,7 @@
<view>{{i.name}}</view>
<view class="cardTit">{{i.price}}</view>
</view>
<view class="note">{{i.content}}</view>
<view class="note">{{i.name}}</view>
</view>
<!-- <view :class="{cur: cardActive == 1, cardCol: true}" @click="cardActive = 1">
<view>福利卡</view>
@ -110,6 +116,11 @@
onLoad(option) {
if (option.promotion_id) {
uni.setStorageSync("base_promotion_id", option.promotion_id)
}
const scene = decodeURIComponent(option.scene);
if (!weixin.isNull(scene)) {
var promotion_id=weixin.getParam(scene,"promotion_id");
uni.setStorageSync("base_promotion_id", promotion_id);
}
weixin.getOpenidInfo(info => {
this.user_info = info

@ -5,7 +5,17 @@ import {
const openid_info_key = appConfig.openidInfoKey
const user_info_key = 'user_info_yunyubang'
export const weixin = {
export const weixin = {
getParam: function(query, variable) {
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
},
request: options => {
if (!options.customLoading) {
uni.showLoading({
@ -132,24 +142,21 @@ export const weixin = {
return uni.getStorageSync(user_info_key)
},
isNull: p => {
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
} // 正则
return p == '' || p == undefined || p == null || p == 'undefined' || p == 'null';
} // 正则
,
getBaseUrl: () => {
return appConfig.baseUrl
},
alert: (msg) => {
uni.showModal({
content: msg,
showCancel: false
})
}
}
export function login() {
// uni.login({
// provider: 'weixin',
// success: res => {
// uni.request({
// url: appConfig.baseUrl + '/api/wechat/user-login',
// method: 'POST',
// data: {
// code: res.code,
// iv: '',
// },
// success: result => {
// }
// })
// }
// });
}

Loading…
Cancel
Save