Commit 328eef6b authored by 王能飞's avatar 王能飞

Merge branch 'c_client_taro-pack' into 'c_client_taro'

C client taro pack

See merge request !56
parents fa8b779c bc130766
......@@ -81,6 +81,17 @@ const config = {
generateScopedName: '[name]__[local]___[hash:base64:5]'
}
}
},
webpackChain(chain, webpack) {
chain.module
.rule('less')
.pre()
.use('style-resources')
.loader('style-resources-loader')
.options({
patterns: path.resolve(__dirname, '../src/styles/index.less'),
injector: 'append'
})
}
}
}
......
......@@ -5344,21 +5344,6 @@
"prop-types": "^15.7.2"
}
},
"tbcc-sdk-ts": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.13.tgz",
"integrity": "sha512-dupA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626mQ==",
"requires": {
"@types/lodash": "^4.14.160",
"@types/node": "^14.6.0",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.0.5"
}
},
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
......
......@@ -53,7 +53,7 @@
"react": "^17.0.0",
"react-dom": "^17.0.0",
"taro-ui": "^3.0.0-alpha.3",
"tbcc-sdk-ts": "^1.0.13"
"tbcc-sdk-ts": "^1.0.15"
},
"devDependencies": {
"@babel/core": "^7.8.0",
......
......@@ -23,12 +23,6 @@ export default {
"pages": [
'game/game'
]
},
{
"root": "pages/packageComs",
"pages": [
'comsTest/comsTest'
]
}
],
window: {
......@@ -42,9 +36,9 @@ export default {
version: '*',
provider: '3000000026642582'
},
memberBenefit: {
version: '*',
provider: '3000000043103783'
}
// memberBenefit: {
// version: '*',
// provider: '3000000043103783'
// }
}
}
\ No newline at end of file
......@@ -13,15 +13,15 @@ const { env, tornadoAPI, defaultActivityId, requestType } = config
cloud.init({ env })
Taro.onError(msg => {
Taro?.onError && Taro?.onError(msg => {
cloundAlarm(msg, env, requestType)
})
class App extends Component {
onLaunch(options) {
console.log('options :>> ', options)
const { activityId } = options.query || {}
const app = getApp()
const { activityId } = options?.query || {}
const app = Taro?.getApp() || {}
app.cloud = cloud
app.tornadoAPI = tornadoAPI
app.activityId = activityId || defaultActivityId
......
export default {
env: 'test', // 云函数环境 test 测试环境 online 线上环境
requestType: 'cloud', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
requestType: 'yapi', // cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'HipPopGame', // 主云函数项目名 CommonToC
sellerId: '4004811045',
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
......
......@@ -13,6 +13,12 @@ export function useAuth(authSuccess = () => {}) {
const onHandleSetting = useThrottle(async () => {
const res = await getSetting()
if(!res.authSetting?.userInfo) {
await getAuthorize()
}else {
authUserInfo()
}
})
const getAuthorize = async () => {
const authResult = await authorize().catch(err => {
setVisible(true)
showToast({ title: '请先授权,授权成功后才可参与活动' })
......@@ -21,10 +27,7 @@ export function useAuth(authSuccess = () => {}) {
if(authResult) {
authUserInfo()
}
}else {
authUserInfo()
}
})
// 打开授权设置
const onOpenSetting = useThrottle(async () => {
if(!completeHandle.current) return;
......@@ -34,7 +37,7 @@ export function useAuth(authSuccess = () => {}) {
// 获取用户授权信息
const authUserInfo = async() => {
completeHandle.current = true
const info = await getAuthUserInfo()
const info = await getAuthUserInfo().catch(err => getAuthorize())
if (info) {
authSuccess(info)
setVisible && setVisible(false)
......
export default {
navigationBarTitleText: '游戏页面',
enableSkia: 'true',
allowsBounceVertical: 'NO',
enableShareAppMessage: true,
usingComponents: {}
}
\ No newline at end of file
......@@ -10,7 +10,8 @@ const { addStat } = require('../api')
})(this, function() {
'use strict'
console.log('...proxyMd')
const oldPage = Page
return true
const oldPage = Page || {}
const oldComponent = Component
return (
(Page = function(t) {
......
......@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3:
lodash "^4.17.10"
prop-types "^15.7.2"
tbcc-sdk-ts@^1.0.13:
version "1.0.13"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.13.tgz#179c6c7f8529a4b146c73a651f529aa56345b6fa"
integrity sha512-dupA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626mQ==
tbcc-sdk-ts@^1.0.15:
version "1.0.15"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.15.tgz#08ef923b2376f35f99f2df7aab65c76d9cd0c6fd"
integrity sha512-d4wz5cOTBbtWmYVl/3dvVjqFEsnnDK+Sp3RPqWEJPA86Kp8ra2Krox8VAIG78amPo8z9KG2ZioGXhxlufUpT8Q==
optionalDependencies:
"@types/lodash" "^4.14.160"
"@types/node" "^14.6.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment