Commit b8129eda Harvey

300w

1 个父辈 da130b05
//const baseUrl = 'https://app.ydniu.com/graphql' //const baseUrl = 'https://app.ydniu.com/graphql'
const baseUrl = '/test_graphql' //const baseUrl = '/test_graphql'
//const baseUrl = '/graphql' const baseUrl = '/graphql'
function request(options = {}) { function request(options = {}) {
let header = Object.assign({ let header = Object.assign({
...@@ -42,13 +42,13 @@ async function graphql(options = {}) { ...@@ -42,13 +42,13 @@ async function graphql(options = {}) {
body.push(`${opts.type}{${opts.name}`) body.push(`${opts.type}{${opts.name}`)
if (opts.args) body.push(`(${opts.args})`) if (opts.args) body.push(`(${opts.args})`)
if (opts.body) body.push(`{${opts.body}}`) if (opts.body) body.push(`{${opts.body}}`)
body.push('}') body.push('}')
const res = await post({ const res = await post({
data: { data: {
query: body.join('') query: body.join('')
} }
}) })
return res.data.data[opts.name] return res.data.data[opts.name]
} }
...@@ -58,4 +58,4 @@ uni.$u.request = { ...@@ -58,4 +58,4 @@ uni.$u.request = {
get, get,
post, post,
graphql graphql
} }
...@@ -5,20 +5,15 @@ ...@@ -5,20 +5,15 @@
:data-v="item.value" @click="navChange" :key="i">{{item.text}}</button> :data-v="item.value" @click="navChange" :key="i">{{item.text}}</button>
</view> </view>
<view class="content"> <view class="content">
<!-- <view v-for="(item,index) in list" class="msg-info" :key="index">
<image :mode="mode||item.mode" lazy-load="true" :src="item.src+'/small'" @click="imgClick(index)">
</image>
<view class="tip">{{item.text}}</view>
</view> -->
<view class='left'> <view class='left'>
<div v-for="(item,index) in leftData" class="msg-info" :key="index"> <div v-for="(item,index) in leftData" class="msg-info" :key="index">
<image :mode="mode" lazy-load="true" :src="item.src+'/eshop'" @click="imgClick(item)"></image> <image :mode="mode" lazy-load="true" :src="item.src+'/300w'" @click="imgClick(item)"></image>
<view class="tip">{{item.text}}</view> <view class="tip">{{item.text}}</view>
</div> </div>
</view> </view>
<view class="right"> <view class="right">
<div v-for="(item,index) in rightData" class="msg-info" :key="index"> <div v-for="(item,index) in rightData" class="msg-info" :key="index">
<image :mode="mode" :src="item.src+'/eshop'" @click="imgClick(item)"></image> <image :mode="mode" lazy-load="true" :src="item.src+'/300w'" @click="imgClick(item)"></image>
<view class="tip">{{item.text}}</view> <view class="tip">{{item.text}}</view>
</div> </div>
</view> </view>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!