Commit 78cd5e22 by 张立顺

代码合并冲突解决

2 parents 5b77ff9f 753237a9
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/store-assistant.iml" filepath="$PROJECT_DIR$/.idea/store-assistant.iml" />
</modules>
</component>
</project>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="bd1fb5f0-1648-410c-bbf9-a5683a23085f" name="变更" comment="">
<change beforePath="$PROJECT_DIR$/pages/index/index.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/tab/index/index.json" beforeDir="false" afterPath="$PROJECT_DIR$/pages/tab/index/index.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/tab/index/index.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/pages/tab/index/index.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/project.private.config.json" beforeDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="2GF5TNpchj3Dij8T8FN6d5otL3G" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="默认任务">
<changelist id="bd1fb5f0-1648-410c-bbf9-a5683a23085f" name="变更" comment="" />
<created>1665971500524</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1665971500524</updated>
</task>
<servers />
</component>
</project>
\ No newline at end of file \ No newline at end of file
<!--pages/index/index.wxml--> <!--pages/index/index.wxml-->
<text>pages/index/index.wxml</text> <text>pages/index/index.wxml</text>
{ {
"usingComponents": { "usingComponents": {
"active-box": "./components/activeBox/activeBox", "van-button": "@vant/weapp/button/index"
"activity-diagnosis": "./components/activityDiagnosis/activityDiagnosis"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 10, "onReachBottomDistance": 10,
......
...@@ -3,40 +3,4 @@ ...@@ -3,40 +3,4 @@
<view class="bar-text">门店助手</view> <view class="bar-text">门店助手</view>
</navigation-bar> </navigation-bar>
</view> </view>
<block wx:if="{{navHeight}}">
<view class="layout" style="top:{{navHeight}}px">
<!-- 背景图 -->
<view class="bg-box" style="height:{{368 + navHeight * 2}}rpx;top:-{{navHeight}}px">
<view class="bg">
<image webp src="{{IMGURL}}/index_bg.png?v={{img_version}}"></image>
</view>
</view>
<view class="content">
<!-- tab切换 -->
<view class="tab-box" style="top: {{navHeight}}px">
<block wx:for="{{tab}}" wx:key="index">
<view class="tab {{index == tabIndex? 'active' : '' }}" bindtap="click" data-index="{{index}}">
<view class="text">{{item.name}} ({{item.account}})</view>
<view class="line"></view>
</view>
</block>
</view>
<!-- 活动中 -->
<view class="active-content">
<block wx:if="{{tabIndex == 0}}">
<active-box activeList="{{activeList}}"></active-box>
</block>
</view>
<!-- 活动诊断 -->
<view class="activity-diag-content">
<block wx:if="{{tabIndex == 1}}">
<activity-diagnosis activityList="{{activityEndList}}"></activity-diagnosis>
</block>
</view>
</view>
<!-- 申请活动 -->
<view class="add-activity" bind:tap="applyActivity">
<image webp src="{{IMGURL}}application_activity.png"></image>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
<van-button type="warning">警告按钮</van-button>
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
"nodeModules": false, "nodeModules": false,
"enhance": true, "enhance": true,
"useMultiFrameRuntime": true, "useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"minifyWXSS": true, "minifyWXSS": true,
"disableUseStrict": false, "disableUseStrict": false,
...@@ -53,7 +51,7 @@ ...@@ -53,7 +51,7 @@
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
"tabSize": 2 "tabSize": 2
}, },
"libVersion": "2.23.4", "condition": {},
"packOptions": { "packOptions": {
"ignore": [ "ignore": [
{ {
...@@ -63,7 +61,5 @@ ...@@ -63,7 +61,5 @@
], ],
"include": [] "include": []
}, },
"appid": "wxe10067a63c1856ac", "appid": "wx570d9331f9ace0bd"
"projectname": "miniprogram-scrm-shopmall",
"condition": {}
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
* 微信小程序标准版:统一封装的 storage 操作类 * 微信小程序标准版:统一封装的 storage 操作类
*/ */
import { DEFAULT_GET_STORAGEKEY, GET_STORAGE_OBJECTkEY } from '~/utils/constantData' import { DEFAULT_GET_STORAGEKEY, STORAGE_OBJECTkEY } from '~/utils/constantData'
class Storage { class Storage {
types = { types = {
1: 'get', // get 1: 'get', // get
...@@ -15,7 +14,7 @@ class Storage { ...@@ -15,7 +14,7 @@ class Storage {
trial: '体验版', trial: '体验版',
release: '正式版' release: '正式版'
} }
// defaultGetStorageKey = DEFAULT_GET_STORAGEKEY
/** 构造函数 */ /** 构造函数 */
constructor() { constructor() {
/** 获取当前小程序环境变量 */ /** 获取当前小程序环境变量 */
...@@ -40,6 +39,7 @@ class Storage { ...@@ -40,6 +39,7 @@ class Storage {
throw new Error(`Storage ${this.types[type]} func: key can not be empty`) throw new Error(`Storage ${this.types[type]} func: key can not be empty`)
return false return false
} }
// if STORAGE_OBJECTkEY[key]
return tmpKey return tmpKey
} }
return key return key
...@@ -51,31 +51,32 @@ class Storage { ...@@ -51,31 +51,32 @@ class Storage {
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步 * @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/ */
get = (key, syncFlag = true) => { get = (key, syncFlag = true) => {
// 有key值 // 有值默认取key值
if (key) { if (key) {
// 判断值是否是指定的对象值
let tmpKey = this.checkKeyType(key, 1) let tmpKey = this.checkKeyType(key, 1)
let isObjectKey = STORAGE_OBJECTkEY[tmpKey]
// 判断值是否是指定的对象值 是取定义的好的映射值 // console.log(key)
let isObjectKey = GET_STORAGE_OBJECTkEY[key] // console.log(isObjectKey)
if (isObjectKey) { if (isObjectKey) {
return this.getObjectKeyValue(isObjectKey) return this.getObjectKeyValue(isObjectKey)
} else { } else {
return this.getKeyValue(tmpKey, syncFlag) throw new Error(`Storage ${this.types[1]} ${key}: key must be register`)
} }
} else { } else {
// 为空取默认定义好的数组值
return this.getObjectKeyValue(DEFAULT_GET_STORAGEKEY) return this.getObjectKeyValue(DEFAULT_GET_STORAGEKEY)
} }
} }
/** /**
* *
* @param {*} key | 要操作的键值 * @param {*} 空key返回默认定义数组的值
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/ */
getKeyValue(tmpKey, syncFlag) { getObjectKeyValue(key) {
if (syncFlag) { // ObjectList
let res = wx.getStorageSync(tmpKey) if (typeof key == 'string') {
key = this.addEvnToKey(key)
let res = wx.getStorageSync(key)
if (res) { if (res) {
return JSON.parse(res) return JSON.parse(res)
} else { } else {
...@@ -83,35 +84,15 @@ class Storage { ...@@ -83,35 +84,15 @@ class Storage {
return '' return ''
} }
} else { } else {
return new Promise((resolve, reject) => { let Obj = {}
wx.getStorage({ key.forEach(key => {
key: tmpKey, let defaultKey = this.addEvnToKey(key)
success: res => { let res = wx.getStorageSync(defaultKey)
resolve(JSON.parse(res.data)) Obj[key] = res ? JSON.parse(res) : ''
},
fail: err => {
// console.log(err)
// reject(errMsg)
resolve('')
}
})
}) })
return Obj
} }
} }
/**
*
* @param {*} 空key返回默认定义数组的值
*/
getObjectKeyValue(ObjectList) {
let Obj = {}
ObjectList.forEach(key => {
let defaultKey = this.addEvnToKey(key)
let res = wx.getStorageSync(defaultKey)
Obj[key] = res ? JSON.parse(res) : ''
})
return Obj
}
/** /**
* *
* @param {*} key | 要操作的键值 * @param {*} key | 要操作的键值
......
...@@ -4,20 +4,26 @@ const $Storage = new Storage() ...@@ -4,20 +4,26 @@ const $Storage = new Storage()
// console.log($Storage) // console.log($Storage)
/** */ /** */
export function getSessionId() { export function getSessionId() {
return $Storage.get('scrm_shopmall_sessionId') return $Storage.get('sessionId')
} }
export function setSessionId(sessionId) { export function setSessionId(sessionId) {
$Storage.set('scrm_shopmall_sessionId', sessionId) $Storage.set('sessionId', sessionId)
}
export function getUserInfo() {
return $Storage.get('userInfo')
}
export function setUserInfo(data) {
$Storage.set('userInfo', data)
} }
export function removeSystemStorage() { export function removeSystemStorage() {
$Storage.rm('srcm_shopmall_user_info') // $Storage.rm('srcm_shopmall_user_info')
$Storage.rm('scrm_shopmall_sessionId') // $Storage.rm('scrm_shopmall_sessionId')
$Storage.rm('guest_no') // $Storage.rm('guest_no')
$Storage.rm('equity_info') // $Storage.rm('equity_info')
$Storage.rm('packageList') // $Storage.rm('packageList')
$Storage.rm('isVIP') // $Storage.rm('isVIP')
$Storage.rm('bizjiaUrl') // $Storage.rm('bizjiaUrl')
$Storage.rm('vip_card_info') // $Storage.rm('vip_card_info')
} }
export function setStorageSync(key, data) { export function setStorageSync(key, data) {
$Storage.set(key, JSON.stringify(data)) $Storage.set(key, JSON.stringify(data))
...@@ -29,22 +35,22 @@ export function getStorageSync(key) { ...@@ -29,22 +35,22 @@ export function getStorageSync(key) {
/**设置标题栏 */ /**设置标题栏 */
export function setNavigationBarTitleText(title) { export function setNavigationBarTitleText(title) {
$Storage.set('dj_shopmall_app_title', title) $Storage.set('app_title', title)
} }
/**获取app标题 */ /**获取app标题 */
export function getNavigationBarTitleText() { export function getNavigationBarTitleText() {
return $Storage.get('dj_shopmall_app_title') return $Storage.get('app_title')
} }
/** 存储设备信息 */ /** 存储设备信息 */
export function setSystem_info(that) { export function setSystem_info(that) {
let info = $Storage.get('srcm_shopmall_system_info') let info = $Storage.get('system_info')
!info && !info &&
wx.getSystemInfo({ wx.getSystemInfo({
success(res) { success(res) {
// console.log(res) // console.log(res)
$Storage.set('srcm_shopmall_system_info', res) $Storage.set('system_info', res)
} }
}) })
} }
/**获取用户信息 */ /**获取用户信息 */
export function getUserInfo() { export function getUserInfo() {
let user = wx.$storage.get('srcm_shopmall_user_info') || null let user = wx.$storage.get('userInfo') || null
return user return user
} }
/**设置用户信息 */ /**设置用户信息 */
export function setUserInfo(userInfo) { export function setUserInfo(userInfo) {
wx.$storage.set('srcm_shopmall_user_info', userInfo) wx.$storage.set('userInfo', userInfo)
} }
export function isMember(isNeedToHttp, callBack) { export function isMember(isNeedToHttp, callBack) {
......
...@@ -4,6 +4,13 @@ export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/sto ...@@ -4,6 +4,13 @@ export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/sto
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo'] export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
// 缓存get方法key的对应才映射值 // 缓存get方法key的对应才映射值
export const GET_STORAGE_OBJECTkEY = { export const STORAGE_OBJECTkEY = {
super: ['sessionId', 'merchantId', 'userInfo'] DEFAULT_GET_STORAGEKEY,
sessionId: 'sessionId',
userInfo: 'userInfo',
system_info: 'systemInfo',
app_title: 'appTitle',
auto_login_object: 'auto_login_object',
address_info: 'address_info',
srcm_shopmall_merchant_id: 'srcm_shopmall_merchant_id'
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!