完善redis数据区分环境影院渠道等信息

dev
RogerWork 1 month ago
parent 0a370cd1d0
commit 4d9b592ef4
  1. 32
      src/apis/ec_api.js
  2. 10
      src/components/ec_api/CinemaGoods.vue
  3. 10
      src/components/ec_api/EcardLevel.vue
  4. 10
      src/components/ec_api/MovieShow.vue
  5. 10
      src/components/ec_api/SeatStatus.vue
  6. 21
      src/components/ec_api/TabArea.vue

@ -84,15 +84,20 @@ export const ec_api_send_request = (req_data) => {
env: req_data.env, env: req_data.env,
member_type: req_data.type, member_type: req_data.type,
api: req_data.api, api: req_data.api,
cid: req_data.cid,
pid: req_data.pid,
params: req_data.params, params: req_data.params,
} }
}) })
} }
export const ec_api_get_suggest = (api_type, api, options) => { export const ec_api_get_suggest = (api_type, api, env, cid, pid, options) => {
let req_params = { let req_params = {
member_type: api_type, member_type: api_type,
api: api api: api,
env: env,
cid: cid,
pid: pid,
} }
console.log('ec_api_get_suggest -- options', options) console.log('ec_api_get_suggest -- options', options)
if (options) { if (options) {
@ -105,10 +110,13 @@ export const ec_api_get_suggest = (api_type, api, options) => {
}) })
} }
export const ec_api_get_suggest_timestamp = (api_type, api, options=null) => { export const ec_api_get_suggest_timestamp = (api_type, api, env, cid, pid, options = null) => {
let req_params = { let req_params = {
member_type: api_type, member_type: api_type,
api: api api: api,
env: env,
cid: cid,
pid: pid,
} }
if (options !== null) { if (options !== null) {
req_params['options'] = options req_params['options'] = options
@ -128,7 +136,10 @@ export const ec_api_set_user_data = (req_data) => {
api: req_data.api, api: req_data.api,
member_type: req_data.member_type, member_type: req_data.member_type,
format: req_data.format, format: req_data.format,
user_data: req_data.user_data user_data: req_data.user_data,
env: req_data.env,
cid: req_data.cid,
pid: req_data.pid,
} }
}) })
} }
@ -138,8 +149,11 @@ export const ec_api_clear_user_data = (req_data) => {
url: 'ec/clear_user_data', url: 'ec/clear_user_data',
method: 'post', method: 'post',
data: { data: {
api: req_data['api'], api: req_data.api,
member_type: req_data['member_type'], member_type: req_data.member_type,
env: req_data.env,
cid: req_data.cid,
pid: req_data.pid,
} }
}) })
} }

@ -6,7 +6,7 @@ import PackageSelector from "@/components/ec_api/PackageSelector.vue";
import GoodsDiscount from "@/components/ec_api/GoodsDiscount.vue"; import GoodsDiscount from "@/components/ec_api/GoodsDiscount.vue";
// TabArea // TabArea
const props = defineProps(['goods', 'data']) const props = defineProps(['goods', 'data', 'base_info'])
// //
const selectGoods = ref([]) const selectGoods = ref([])
@ -35,7 +35,10 @@ async function handle_set_user_data() {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
format: props.data.format, format: props.data.format,
user_data: JSON.stringify(selectGoodsData) user_data: JSON.stringify(selectGoodsData),
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_set_user_data', req_data) console.log('handle_set_user_data', req_data)
await ec_api_set_user_data(req_data).then( await ec_api_set_user_data(req_data).then(
@ -59,6 +62,9 @@ async function handle_clear_user_data() {
const req_data = { const req_data = {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_clear_user_data', req_data) console.log('handle_clear_user_data', req_data)
await ec_api_clear_user_data(req_data).then( await ec_api_clear_user_data(req_data).then(

@ -4,7 +4,7 @@ import {ec_api_set_user_data, ec_api_clear_user_data} from '@/apis/ec_api.js'
import {ElMessage} from "element-plus"; import {ElMessage} from "element-plus";
// TabArea // TabArea
const props = defineProps(['level', 'data']) const props = defineProps(['level', 'data', 'base_info'])
// //
const selectLevel = ref('') const selectLevel = ref('')
@ -22,7 +22,10 @@ async function handle_set_user_data() {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
format: props.data.format, format: props.data.format,
user_data: JSON.stringify(selectLevelData) user_data: JSON.stringify(selectLevelData),
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_set_user_data', req_data) console.log('handle_set_user_data', req_data)
await ec_api_set_user_data(req_data).then( await ec_api_set_user_data(req_data).then(
@ -45,6 +48,9 @@ async function handle_clear_user_data() {
const req_data = { const req_data = {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_clear_user_data', req_data) console.log('handle_clear_user_data', req_data)
await ec_api_clear_user_data(req_data).then( await ec_api_clear_user_data(req_data).then(

@ -4,7 +4,7 @@ import {ec_api_set_user_data, ec_api_clear_user_data} from '@/apis/ec_api.js'
import {ElMessage} from "element-plus"; import {ElMessage} from "element-plus";
// TabArea // TabArea
const props = defineProps(['show', 'data']) const props = defineProps(['show', 'data', 'base_info'])
// //
const selectShow = ref('') const selectShow = ref('')
@ -22,7 +22,10 @@ async function handle_set_user_data() {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
format: props.data.format, format: props.data.format,
user_data: JSON.stringify(selectShowData) user_data: JSON.stringify(selectShowData),
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_set_user_data', req_data) console.log('handle_set_user_data', req_data)
await ec_api_set_user_data(req_data).then( await ec_api_set_user_data(req_data).then(
@ -45,6 +48,9 @@ async function handle_clear_user_data() {
const req_data = { const req_data = {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_clear_user_data', req_data) console.log('handle_clear_user_data', req_data)
await ec_api_clear_user_data(req_data).then( await ec_api_clear_user_data(req_data).then(

@ -5,7 +5,7 @@ import {ElMessage} from "element-plus";
import TicketDiscount from "@/components/ec_api/TicketDiscount.vue"; import TicketDiscount from "@/components/ec_api/TicketDiscount.vue";
// TabArea // TabArea
const props = defineProps(['seat', 'data']) const props = defineProps(['seat', 'data', 'base_info'])
// //
const selectSeats = ref([]) const selectSeats = ref([])
@ -32,7 +32,10 @@ async function handle_set_user_data() {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
format: props.data.format, format: props.data.format,
user_data: JSON.stringify(selectSeatData) user_data: JSON.stringify(selectSeatData),
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_set_user_data', req_data) console.log('handle_set_user_data', req_data)
await ec_api_set_user_data(req_data).then( await ec_api_set_user_data(req_data).then(
@ -64,6 +67,9 @@ async function handle_clear_user_data() {
const req_data = { const req_data = {
api: props.data.path, api: props.data.path,
member_type: props.data.type, member_type: props.data.type,
env: props.base_info.env,
cid: props.base_info.cinema,
pid: props.base_info.channel,
} }
console.log('handle_clear_user_data', req_data) console.log('handle_clear_user_data', req_data)
await ec_api_clear_user_data(req_data).then( await ec_api_clear_user_data(req_data).then(

@ -191,6 +191,8 @@ function handle_request_data() {
data['env'] = UserApiData.value.base_info['env'] data['env'] = UserApiData.value.base_info['env']
data['type'] = UserApiData.value.api[activeTab.value]['type'] data['type'] = UserApiData.value.api[activeTab.value]['type']
data['api'] = UserApiData.value.api[activeTab.value]['path'] data['api'] = UserApiData.value.api[activeTab.value]['path']
data['pid'] = UserApiData.value.base_info['channel']
data['cid'] = UserApiData.value.base_info['cinema']
data['params'] = JSON.stringify(req_data) data['params'] = JSON.stringify(req_data)
return data return data
} }
@ -253,7 +255,11 @@ async function get_suggest(options = {sale_type: saleType.value}) {
if (UserApiData.value.api[activeTab.value].reload === true) { if (UserApiData.value.api[activeTab.value].reload === true) {
const api_type = UserApiData.value.api[activeTab.value].type const api_type = UserApiData.value.api[activeTab.value].type
const api = UserApiData.value.api[activeTab.value].path const api = UserApiData.value.api[activeTab.value].path
await ec_api_get_suggest(api_type, api, options).then( const env = UserApiData.value.base_info['env']
const cid = UserApiData.value.base_info['cinema']
const pid = UserApiData.value.base_info['channel']
await ec_api_get_suggest(api_type, api, env, cid, pid, options).then(
(res) => { (res) => {
console.log('get_suggest', api, res) console.log('get_suggest', api, res)
let result = true let result = true
@ -283,7 +289,10 @@ async function get_suggest(options = {sale_type: saleType.value}) {
async function get_timestamp() { async function get_timestamp() {
const api_type = UserApiData.value.api[activeTab.value].type const api_type = UserApiData.value.api[activeTab.value].type
const api = UserApiData.value.api[activeTab.value].path const api = UserApiData.value.api[activeTab.value].path
await ec_api_get_suggest_timestamp(api_type, api).then( const env = UserApiData.value.base_info['env']
const cid = UserApiData.value.base_info['cinema']
const pid = UserApiData.value.base_info['channel']
await ec_api_get_suggest_timestamp(api_type, api, env, cid, pid).then(
res => { res => {
console.log('get_timestamp', res['timestamp']) console.log('get_timestamp', res['timestamp'])
if (res['timestamp'] > UserApiData.value.api[activeTab.value].timestamp) { if (res['timestamp'] > UserApiData.value.api[activeTab.value].timestamp) {
@ -650,10 +659,10 @@ const ace_options = {
</el-row> </el-row>
<v-ace-editor v-model:value="UserApiData.api[api['id']].response" :lang="UserApiData.api[api['id']]['format']" <v-ace-editor v-model:value="UserApiData.api[api['id']].response" :lang="UserApiData.api[api['id']]['format']"
theme="chrome" :options="ace_options" class="vue-ace-editor" :wrap="true" style="width: 1200px"/> theme="chrome" :options="ace_options" class="vue-ace-editor" :wrap="true" style="width: 1200px"/>
<MovieShow v-if="showList.length > 0" :show="showList" :data="UserApiData.api[activeTab]"/> <MovieShow v-if="showList.length > 0" :show="showList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/>
<SeatStatus v-if="seatList.length > 0" :seat="seatList" :data="UserApiData.api[activeTab]"/> <SeatStatus v-if="seatList.length > 0" :seat="seatList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/>
<CinemaGoods v-if="goodsList.length > 0" :goods="goodsList" :data="UserApiData.api[activeTab]"/> <CinemaGoods v-if="goodsList.length > 0" :goods="goodsList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/>
<EcardLevel v-if="levelList.length > 0" :level="levelList" :data="UserApiData.api[activeTab]"/> <EcardLevel v-if="levelList.length > 0" :level="levelList" :data="UserApiData.api[activeTab]" :base_info="UserApiData.base_info"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-backtop :right="100" :bottom="100" :visibility-height="200"/> <el-backtop :right="100" :bottom="100" :visibility-height="200"/>

Loading…
Cancel
Save