合并代码
This commit is contained in:
parent
22212de146
commit
23b691c539
|
@ -9,7 +9,7 @@ export const durian = {
|
|||
*/
|
||||
durianList(param) {
|
||||
return util.request({
|
||||
url: `/duriantreeinfo/tree-list`,
|
||||
url: `/coreplay/duriantreeinfo/tree-list`,
|
||||
method: 'GET',
|
||||
query: param.query,
|
||||
})
|
||||
|
@ -43,7 +43,7 @@ export const durian = {
|
|||
exchange(param) {
|
||||
return util.request({
|
||||
url: `/app/durian/exchange`,
|
||||
method: 'post',
|
||||
method: 'POST',
|
||||
data: param.data,
|
||||
load: true,
|
||||
})
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
// 配置
|
||||
const config = {
|
||||
// 接口域名
|
||||
// host: 'http://1.94.221.165:8101',
|
||||
// host: 'http://192.168.1.241',
|
||||
// host: '/duriantreeinfo',
|
||||
host: '/user',
|
||||
// host: 'http://192.168.1.236:8080',
|
||||
host: 'http://localhost:5173',
|
||||
// 上传文件二级路径
|
||||
uploadFilePath: "/homecommon/file/preview?fileName=",
|
||||
// 上传视频二级路径
|
||||
|
|
|
@ -91,10 +91,7 @@ const util = {
|
|||
// 默认token
|
||||
let token = uni.getStorageSync('token') || ''
|
||||
// 接口地址
|
||||
obj.url = obj.url ? obj.url : api[{
|
||||
img: 'uploadImg',
|
||||
video: 'uploadVideo',
|
||||
} [obj.mode]]
|
||||
obj.url = obj.url ? obj.url : '/file/upload'
|
||||
console.log('obj.url', obj.url)
|
||||
// 文件
|
||||
obj.file = obj.file ? obj.file : ""
|
||||
|
|
|
@ -205,7 +205,7 @@
|
|||
// 内容
|
||||
.content {
|
||||
.style1 {
|
||||
color: #FF8400;
|
||||
// color: #FF8400;
|
||||
|
||||
// 商家标签
|
||||
.label {
|
||||
|
|
|
@ -29,12 +29,13 @@
|
|||
const {
|
||||
proxy
|
||||
} = getCurrentInstance()
|
||||
const store = useStore()
|
||||
// 榴莲果树列表
|
||||
const viewData = ref([])
|
||||
// 当前选择的榴莲果树对象
|
||||
const selectItem = ref({})
|
||||
// 规则文章
|
||||
const rule = reactive({})
|
||||
const store = useStore()
|
||||
const userinfo = computed(() => {
|
||||
let result = store.state.userinfo
|
||||
return result
|
||||
|
@ -44,7 +45,7 @@
|
|||
// 获取可以兑换的榴莲果树
|
||||
buyDurianList()
|
||||
// 获取榴莲果规则文章
|
||||
getArticle()
|
||||
// getArticle()
|
||||
})
|
||||
|
||||
onReady(() => {
|
||||
|
@ -65,15 +66,25 @@
|
|||
* @param {Object} type 1榴莲果兑换 2种子兑换
|
||||
*/
|
||||
function exchange(type) {
|
||||
const config = {
|
||||
'1': {
|
||||
price: selectItem.value.fruitNeed,
|
||||
name: '榴莲果',
|
||||
},
|
||||
'2': {
|
||||
price: selectItem.value.seedNeed,
|
||||
name: '种子',
|
||||
},
|
||||
} [type]
|
||||
util.alert({
|
||||
content: `确认消耗${800}种子购买榴莲果`,
|
||||
content: `确认消耗${config.price}${config.name}购买榴莲果`,
|
||||
}).then(rs => {
|
||||
if (!rs.confirm) return
|
||||
|
||||
durianlApi.exchange({
|
||||
data: {
|
||||
userId: userinfo.value.userId,
|
||||
treeId: selectItem.value.id,
|
||||
// userId: userinfo.value.userId,
|
||||
DurianConfigId: selectItem.value.id,
|
||||
type: type
|
||||
},
|
||||
}).then(rs => {
|
||||
|
@ -83,9 +94,10 @@
|
|||
util.getUserinfo()
|
||||
return
|
||||
}
|
||||
|
||||
util.alert({
|
||||
content: rs.msg,
|
||||
value: false,
|
||||
showCancel: false,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -151,7 +163,7 @@
|
|||
<text>置换1颗{{item.durianName}}</text>
|
||||
</view>
|
||||
|
||||
<view class="button fmid mlr40 wh110 c333 f20 bfff cir" @click="openExchange(item)">置换</view>
|
||||
<view class="button fmid mlr40 wh110 c333 f24 bfff cir" @click="openExchange(item)">置换</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { createStore } from 'vuex'
|
||||
import {
|
||||
createStore
|
||||
} from 'vuex'
|
||||
|
||||
export default createStore({
|
||||
state: {
|
||||
|
@ -8,6 +10,8 @@ export default createStore({
|
|||
tabbarMode: 'default',
|
||||
// 闹钟时间
|
||||
alarmTime: '',
|
||||
// 资产
|
||||
property: {},
|
||||
},
|
||||
|
||||
mutations: {
|
||||
|
@ -22,8 +26,8 @@ export default createStore({
|
|||
state[key] = value
|
||||
},
|
||||
// 设置用户信息
|
||||
setUserInfo(state, payload) {
|
||||
state.userinfo = payload
|
||||
setUserInfo(state, value) {
|
||||
state.userinfo = value
|
||||
},
|
||||
// 设置 tabbar 模式
|
||||
setTabbarMode(state, mode) {
|
||||
|
@ -41,10 +45,14 @@ export default createStore({
|
|||
},
|
||||
|
||||
actions: {
|
||||
updateUserInfo({ commit }, payload) {
|
||||
updateUserInfo({
|
||||
commit
|
||||
}, payload) {
|
||||
commit('setUserInfo', payload)
|
||||
},
|
||||
changeTabbarMode({ commit }, mode) {
|
||||
changeTabbarMode({
|
||||
commit
|
||||
}, mode) {
|
||||
commit('setTabbarMode', mode)
|
||||
},
|
||||
}
|
||||
|
|
|
@ -10,19 +10,20 @@ export default defineConfig({
|
|||
port: 5173,
|
||||
proxy: {
|
||||
"/shopify": {
|
||||
target: "https://3w823u8516.vicp.fun/shopify",
|
||||
target: "https://3w823u8516.vicp.fun",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/shopify/, ""),
|
||||
},
|
||||
"/user": {
|
||||
target: "http://192.168.1.236:8080",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/user/, ""),
|
||||
},
|
||||
"/duriantreeinfo": {
|
||||
"/coreplay": {
|
||||
target: "http://192.168.1.241:9400",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/duriantreeinfo/, ""),
|
||||
},
|
||||
"/file": {
|
||||
target: "http://192.168.1.241:8080",
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue