刘翔宇-旅管家 3 years ago
parent be27a5c4f8
commit 5dbc2c336d

@ -5,7 +5,8 @@
export default { export default {
onLaunch: function() { onLaunch: function() {
weixin.getOpenidInfo(() => {}, true) weixin.getOpenidInfo(() => {}, true)
console.log('App Launch') console.log('App Launch')
const updateManager = uni.getUpdateManager(); const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) { updateManager.onCheckForUpdate(function(res) {

@ -2,8 +2,8 @@ export const appConfig = {
appId: 'wx9b4762770771d98a', //孕育邦 appId: 'wx9b4762770771d98a', //孕育邦
//appId:"wx3dc65ce9b588727a",//孕育咨询 //appId:"wx3dc65ce9b588727a",//孕育咨询
//baseUrl: 'http://yunyubang.localhost.com', //baseUrl: 'http://yunyubang.localhost.com',
baseUrl: 'https://yunyubang2021.langye.net', //孕育邦 baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦
//baseUrl: 'http://yybtest.ali251.langye.net', //baseUrl: 'https://yybtest.ali251.langye.net',
newBaseUrl: 'https://yunyubang.ali251.langye.net', newBaseUrl: 'https://yunyubang.ali251.langye.net',
//newBaseUrl: 'http://yybtest.ali251.langye.net', //newBaseUrl: 'http://yybtest.ali251.langye.net',
//baseUrl:'https://yybtest2021.langye.net',//孕育咨询 //baseUrl:'https://yybtest2021.langye.net',//孕育咨询

@ -1,9 +1,11 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App' import App from './App'
import {appConfig} from './config' import {appConfig} from './config'
import {weixin} from './utils/weixin.js' import {weixin} from './utils/weixin.js'
import {util} from './utils/util.js'
import uView from "uview-ui"; import uView from "uview-ui";
Vue.use(uView); Vue.use(uView);
Vue.prototype.util = util;
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.baseUrl = appConfig.baseUrl Vue.prototype.baseUrl = appConfig.baseUrl

@ -285,8 +285,11 @@
}, },
onShow() { onShow() {
var that = this; var that = this;
weixin.getOpenidInfo(info => { console.log("01.onShow",that);
weixin.getOpenidInfo(info => {
console.log("02.getOpenidInfo",info);
that.user_info = info.user_info; that.user_info = info.user_info;
that.openid = that.user_info.openid; that.openid = that.user_info.openid;
that.form.member_name = that.user_info.name || that.user_info.wechat_nickname; that.form.member_name = that.user_info.name || that.user_info.wechat_nickname;
@ -417,7 +420,7 @@
this.form.hospital = this.arrHospital[e.target.value]; this.form.hospital = this.arrHospital[e.target.value];
} }
}, },
getPoster: function() { getPoster: function() {
var that = this; var that = this;
uni.getImageInfo({ uni.getImageInfo({
@ -804,7 +807,9 @@
for (var m of res) { for (var m of res) {
m.poster = (weixin.isNull(m.poster) ? "../../static/750x500.jpg" : m.poster = (weixin.isNull(m.poster) ? "../../static/750x500.jpg" :
m.poster_url) m.poster_url)
m.created_at = m.created_at.split("T")[0] + " " + m.created_at.split("T")[1] if (m.created_at.indexOf('T') > 0)
m.created_at = m.created_at.split("T")[0] + " " + m.created_at.split("T")[
1]
.split(".")[0] .split(".")[0]
} }

@ -129,6 +129,9 @@
} }
if (options.product_type_id) { if (options.product_type_id) {
this.product_type_id = options.product_type_id this.product_type_id = options.product_type_id
}
if (options.keyword) {
this.keyword = options.keyword;
} }
}, },
onShow() { onShow() {
@ -190,8 +193,11 @@
var dataList = that.dataList; var dataList = that.dataList;
for (var m of res) { for (var m of res) {
m.created_at = m.created_at.split("T")[0] + " " + m.created_at.split("T")[1] if (m.created_at.indexOf('T') > 0)
.split(".")[0]; m.created_at = m.created_at.split("T")[0] + " " + m.created_at.split("T")[
1].split(".")[0];
m.poster = (weixin.isNull(m.poster) ? "../../static/rishang.png" : m m.poster = (weixin.isNull(m.poster) ? "../../static/rishang.png" : m
.poster_url) .poster_url)
} }

@ -79,8 +79,8 @@
<view class="subBtn view" v-if="info.state=='unpaid'" @click="tocancel(info.id)"></view> <view class="subBtn view" v-if="info.state=='unpaid'" @click="tocancel(info.id)"></view>
<view class="subBtn pay" v-if="info.state=='unpaid'" @click="topay(info.id)"></view> <view class="subBtn pay" v-if="info.state=='unpaid'" @click="topay(info.id)"></view>
<view class="subBtn cancel" <view class="subBtn cancel"
v-if="info.state!='unpaid'&&info.bookable_type=='product'&&info.items[0].state=='pending'" v-if="info.state!='unpaid'&&info.bookable_type=='product'&&info.items.state=='pending'"
@click="tocancelApply(info.items[0].id)">退单</view> @click="tocancelApply(info.items.id)">退单</view>
</view> </view>
</view> </view>
</template> </template>

@ -1,7 +1,13 @@
<template> <template>
<view class="content"> <view class="content">
<view class="activeTop"> <view class="activeTop">
<view class="searchBox">
<view class="searchCol">
<view class="iconfont icon-search1"></view>
<input type="text" placeholder="请输入关键字" @confirm="toSearch" />
</view>
<view class="iconfont icon-w_location-"></view>
</view>
<view class="album_swiper"> <view class="album_swiper">
<swiper :autoplay="autoplay" :interval="interval" :duration="duration" :indicator-dots="true" <swiper :autoplay="autoplay" :interval="interval" :duration="duration" :indicator-dots="true"
indicator-active-color="rgba(255,255,255,0.5)" indicator-color="rgba(255,255,255,1)"> indicator-active-color="rgba(255,255,255,0.5)" indicator-color="rgba(255,255,255,1)">
@ -119,6 +125,12 @@
this.loadPage((this.currentPage + 1), '', 6, 1) this.loadPage((this.currentPage + 1), '', 6, 1)
}, },
methods: { methods: {
toSearch(e) {
console.log(e)
uni.navigateTo({
url: "/packages/packageBuy/pages/shopList/shopList?keyword=" + e.detail.value
})
},
async getNav(code) { async getNav(code) {
await weixin.request({ await weixin.request({
newUrl: true, newUrl: true,
@ -267,7 +279,6 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.activeTop { .activeTop {
width: 100%; width: 100%;
height: 342rpx;
background: linear-gradient(180deg, #FF578A 0%, rgba(255, 87, 138, 0) 100%); background: linear-gradient(180deg, #FF578A 0%, rgba(255, 87, 138, 0) 100%);
} }

@ -101,12 +101,13 @@ export const weixin = {
options.utilFail('TODO: 特殊处理非200错误(' + res.statusCode + ')'); options.utilFail('TODO: 特殊处理非200错误(' + res.statusCode + ')');
} }
} }
} else { } else {
if (!weixin.isNull(res.data.errorcode) || res.data.errorcode == 0) { console.log(res)
if (res.data.hasOwnProperty('errcode')) {
if (options.utilFail != undefined) { if (options.utilFail != undefined) {
options.utilFail(res.data.errormsg || '接口发生未知错误'); options.utilFail(res.data.errmsg || '接口发生未知错误');
} else { } else {
options.utilFail(res.data.errormsg); options.utilFail(res.data.errmsg);
} }
} else { } else {
if (options.utilSuccess != undefined) { if (options.utilSuccess != undefined) {
@ -144,14 +145,16 @@ export const weixin = {
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (res) => { success: (res) => {
console.log(res.code)
uni.request({ uni.request({
url: appConfig.baseUrl + '/api/member/login-by-code', url: appConfig.baseUrl + '/api/member/login-by-code',
method: 'POST', method: 'POST',
data: { data: {
code: res.code code: res.code
}, },
success: result => { success: result => {
console.log(result)
const user_info1 = result.data.data.user_info const user_info1 = result.data.data.user_info
result.data.data.user_info.openid = user_info1.wechat_openid result.data.data.user_info.openid = user_info1.wechat_openid
uni.setStorageSync(user_info_key, result.data.data) uni.setStorageSync(user_info_key, result.data.data)

Loading…
Cancel
Save