|
@@ -1,7 +1,8 @@
|
|
|
// const io = require('./socket.io-mp');
|
|
|
+// const { io } = require('./socket.io-v4.msgpack.js');
|
|
|
const {
|
|
|
io
|
|
|
-} = require('./socket.io-v4')
|
|
|
+} = require('./socket.io-v4.js');
|
|
|
var user = require('./services/user.js');
|
|
|
const api = require('/config/api.js');
|
|
|
const util = require('/utils/util.js');
|
|
@@ -18,6 +19,7 @@ wx.getSystemInfo({
|
|
|
isIos = res.platform == "ios"
|
|
|
}
|
|
|
})
|
|
|
+const testSocket = true
|
|
|
|
|
|
|
|
|
let urlToJson = (url = window.location.href) => { // 箭头函数默认传值为当前页面url
|
|
@@ -40,9 +42,13 @@ let urlToJson = (url = window.location.href) => { // 箭头函数默认传值为
|
|
|
|
|
|
export default {
|
|
|
joinUrl() {
|
|
|
+
|
|
|
+ const url = testSocket ? this.data.url.replace('shop.html', 'test-shop.html') : this.data.url;
|
|
|
+
|
|
|
+ console.log('url', url)
|
|
|
let options = {
|
|
|
API_BASE_URL: api.API_BASE_URL,
|
|
|
- "url": this.data.url,
|
|
|
+ "url": url,
|
|
|
// "url": 'http://192.168.0.112:8080',
|
|
|
"reload": this.data.reload,
|
|
|
"token": wx.getStorageSync('token'),
|
|
@@ -296,7 +302,7 @@ export default {
|
|
|
console.log('小程序参数', options)
|
|
|
let socket = io(remote.socketHost, {
|
|
|
path: '/fsl-node',
|
|
|
- transport:['websocket'],
|
|
|
+ transport: ['websocket'],
|
|
|
query: {
|
|
|
...options,
|
|
|
isClient: true,
|
|
@@ -927,8 +933,8 @@ export default {
|
|
|
|
|
|
async getCouponList(id) {
|
|
|
const success = (res) => {
|
|
|
-
|
|
|
- const data = res.data || res.message
|
|
|
+
|
|
|
+ const data = res.data || res.message
|
|
|
this.setData({
|
|
|
coupons: data.list.map(item => {
|
|
|
item.typeMoney = item.typeMoney.toString()
|