vip-dialog.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. var vipDialog = `
  2. <div class="vip_openDialog">
  3. <div class="vip_content">
  4. <div class="vip_content_div">
  5. <img class="vip_img" :src="imgurl" />
  6. <span class="vip_example">示例</span>
  7. </div>
  8. </div>
  9. <div class="vip_head">
  10. <span style="display:none;">{{getTextMap.titleText}}</span>
  11. <span class="vip_extend"><span>{{getTextMap.headText.top}}</span><br/>{{getTextMap.headText.bot}}</span>
  12. </div>
  13. <div class="openBtn">
  14. <button class="goBtn" @click="goOpen(getTextMap.source)">{{getTextMap.btnText}}</button>
  15. </div>
  16. <p class="no-login-tip" v-if="!islogin">登录后解锁会员查看更多内容</p>
  17. </div>
  18. `
  19. var vipComponent = {
  20. name: 'vip-dialog',
  21. template: vipDialog,
  22. props: {
  23. 'imgurl': {
  24. type: String,
  25. default: function() {
  26. return ''
  27. }
  28. },
  29. "canFreeExp": {
  30. type: Boolean,
  31. default: function () {
  32. return false
  33. }
  34. },
  35. "entvisit": {
  36. type: Object,
  37. default: function () {
  38. return {
  39. total: 0, // 本月画像次数总量
  40. usage: 0, // 本月已使用次数
  41. provin: 0 // 购买省份数量
  42. }
  43. }
  44. },
  45. "type": {
  46. type: String,
  47. default: function () {
  48. return ''
  49. }
  50. },
  51. "vipststus": {
  52. type: Number,
  53. default: function () {
  54. return 0
  55. }
  56. },
  57. "power": {
  58. type: Object,
  59. default: function () {
  60. return {}
  61. }
  62. },
  63. 'newvip': {
  64. type: Boolean,
  65. default: function() {
  66. return false
  67. }
  68. },
  69. 'islogin': {
  70. type: Boolean,
  71. default: function() {
  72. return false
  73. }
  74. }
  75. },
  76. data: function() {
  77. return {
  78. titleText: '开通超级订阅',
  79. btnText: '去开通',
  80. headText: {
  81. top: '通过实时监控项目的招标、中标、合同等',
  82. bot: '信息,全面挖掘更多潜在商机!'
  83. }
  84. }
  85. },
  86. computed: {
  87. getTextMap () {
  88. // console.log(this.power)
  89. var textMap = {
  90. titleText: '开通超级订阅',
  91. btnText: '去开通',
  92. headText: {
  93. top: '通过实时监控项目的招标、中标、合同等',
  94. bot: '信息,全面挖掘更多潜在商机!'
  95. },
  96. source: ''
  97. }
  98. // console.log(this.power, this.power.isMember, this.power._4, this.power._13, this.newvip,this.entvisit, this.power.vipStatus)
  99. if (this.power.isMember > 0 ) {
  100. if (this.entvisit.total <= this.entvisit.usage && this.newvip) {
  101. textMap.btnText = '联系客服'
  102. } else {
  103. if (this.type === 'item_8' || this.type === 'item_9') {
  104. textMap.btnText = '联系客服'
  105. } else {
  106. textMap.btnText = !this.newvip && this.power.vipStatus > 0 ? '前往升级' : '去开通'
  107. }
  108. }
  109. } else {
  110. if (this.entvisit.total <= this.entvisit.usage && this.newvip) {
  111. if (this.entvisit.provin == 0) {
  112. textMap.btnText = '去开通'
  113. } else if (this.entvisit.provin != -1) {
  114. textMap.titleText = '超级订阅'
  115. textMap.btnText = '前往升级'
  116. if (this.type === 'item_8' || this.type === 'item_9') {
  117. textMap.btnText = '免费体验'
  118. }
  119. } else if(this.entvisit.provin == -1) {
  120. textMap.titleText = '超级订阅'
  121. textMap.btnText = '联系客服'
  122. if (this.type === 'item_8' || this.type === 'item_9') {
  123. textMap.btnText = '免费体验'
  124. }
  125. }
  126. } else {
  127. if (this.type === 'item_8' || this.type === 'item_9') {
  128. textMap.btnText = '免费体验'
  129. } else {
  130. textMap.btnText = !this.newvip && this.power.vipStatus > 0 ? '前往升级' : '去开通'
  131. }
  132. }
  133. // (2)【立即解锁】:未体验过企业画像的免费用户,中标分析各模块,点击进行“欢迎体验企业中标分析”留资;
  134. if (this.canFreeExp) {
  135. textMap.btnText = '立即解锁'
  136. } else {
  137. if (this.power.vipStatus <= 0) {
  138. textMap.btnText = '去开通'
  139. } else if (!this.newvip && this.entvisit.provin != -1 && this.entvisit.total >= 0) {
  140. // (4)【前往升级】:超级订阅老版用户,中标分析各模块;购买了非全国的超级订阅新版用户且企业画像余额为0;点击进入超级订阅升级页;
  141. textMap.btnText = '前往升级'
  142. }
  143. }
  144. }
  145. switch (this.type) {
  146. // 项目动态
  147. case 'item_1': {
  148. var buttonText = ''
  149. // 非超级订阅,仅开通了大会员自定义(无13项目动态权限)
  150. if (this.power.vipStatus <= 0 && this.power.isMember > 0 && !this.power._13) {
  151. buttonText = '联系客服'
  152. }
  153. if (buttonText) {
  154. textMap.btnText = buttonText
  155. }
  156. textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
  157. textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
  158. textMap.source = 'ent_portrait_winnerNewMsg_freeuser'
  159. break
  160. }
  161. // 年度项目统计
  162. case 'item_2': {
  163. textMap.titleText = '开通大会员'
  164. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  165. textMap.headText.top = '年度项目规模、增长趋势一目了然,'
  166. textMap.headText.bot = '快速分析市场!'
  167. textMap.source = 'ent_portrait_yearData_freeuser'
  168. break
  169. }
  170. // 月度中标金额统计
  171. case 'item_3': {
  172. textMap.titleText = '开通大会员'
  173. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  174. textMap.headText.top = '纵向对比采购单位各个年份月度采购规模,'
  175. textMap.headText.bot = '不错过任何商机!'
  176. textMap.source = 'ent_portrait_monthData_freeuser'
  177. break
  178. }
  179. // 市场区域分布
  180. case 'item_4': {
  181. textMap.titleText = '开通大会员'
  182. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  183. textMap.headText.top = '通过企业市场规模、市场格局,'
  184. textMap.headText.bot = '分析企业的市场发展现状!'
  185. textMap.source = 'ent_portrait_areaData_freeuser'
  186. break
  187. }
  188. // 各类客户平均折扣率
  189. case 'item_5': {
  190. textMap.titleText = '开通大会员'
  191. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  192. textMap.headText.top = '通过各个年份各类客户平均折扣率范围,'
  193. textMap.headText.bot = '透视企业的行业盈利能力!'
  194. textMap.source = 'ent_portrait_discountRate_freeuser'
  195. break
  196. }
  197. // 客户类型分布
  198. case 'item_6': {
  199. textMap.titleText = '开通大会员'
  200. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  201. textMap.headText.top = '通过企业主要客户类型分析,'
  202. textMap.headText.bot = '洞悉企业业务模式、经营状况!'
  203. textMap.source = 'ent_portrait_top10_freeuser'
  204. break
  205. }
  206. // 重点客户
  207. case 'item_7': {
  208. textMap.titleText = '开通大会员'
  209. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  210. textMap.headText.top = '通过挖掘企业重点及首次合作客户,直观了解'
  211. textMap.headText.bot = '采购单位与供应商关系远近,辅助投标决策!'
  212. textMap.source = 'ent_portrait_topShow_freeuser'
  213. break
  214. }
  215. // 企业情报历史记录(工商变动)
  216. case 'item_8': {
  217. textMap.titleText = '开通大会员'
  218. textMap.btnText = this.power.isMember > 0 && !this.power._12 ? '联系客服' : '免费体验'
  219. textMap.headText.top = '快速查询全国企业工商信息、法人信息、'
  220. textMap.headText.bot = '联系方式,全面掌控企业动态!'
  221. textMap.source = 'ent_portrait_changeList'
  222. break
  223. }
  224. // 历史项目联系方式
  225. case 'item_9': {
  226. textMap.titleText = '开通大会员'
  227. textMap.btnText = this.power.isMember > 0 && this.power.arr.indexOf(4) == -1 ? '联系客服' : '免费体验'
  228. textMap.headText.top = '获取企业联系人信息,一键拨打!'
  229. textMap.headText.bot = ''
  230. textMap.source = 'ent_portrait_contacts'
  231. break
  232. }
  233. // 统计信息-概况
  234. case 'item_10': {
  235. textMap.titleText = ''
  236. textMap.btnText = this.power.isMember > 0 && this.power.arr.indexOf(4) == -1 ? '联系客服' : '免费体验'
  237. textMap.headText.top = '全面透视企业历史中标项目、中标'
  238. textMap.headText.bot = '金额、客户数量'
  239. textMap.source = 'ent_portrait_bidInfoDesc'
  240. break
  241. }
  242. default: {
  243. textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
  244. textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
  245. textMap.source = 'ent_portrait_new_free'
  246. break
  247. }
  248. }
  249. // 未登录
  250. if(!this.islogin) {
  251. textMap.btnText = '登录查看'
  252. }
  253. return textMap
  254. },
  255. },
  256. methods: {
  257. goOpenOfApp: function (btnText, source) {
  258. switch (btnText) {
  259. case '去开通': {
  260. if(this.type == 'item_9' || this.type == 'item_8') {
  261. // 跳转到大会员
  262. // location.href = '/jyapp/big/page/buy_commit'
  263. location.href = '/jy_mobile/common/order/create/bigmember'
  264. // location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=ent_portrait'
  265. } else {
  266. // 跳转到超级订阅
  267. // location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
  268. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  269. }
  270. break
  271. }
  272. case '免费体验': {
  273. location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + source
  274. break
  275. }
  276. case '前往升级': {
  277. //跳转清除旧套餐缓存,防止计算价格出错
  278. sessionStorage.removeItem('vipSub_oldBuySet')
  279. // location.href = '/jyapp/vipsubscribe/upgradePage'
  280. location.href = '/jy_mobile/common/order/create/svip?type=upgrade'
  281. break
  282. }
  283. case '联系客服': {
  284. location.href = '/jyapp/free/customer'
  285. break
  286. }
  287. case '立即解锁': {
  288. location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=ent_portrait_freeuser'
  289. break
  290. }
  291. case '登录查看': {
  292. location.href = '/jyapp/free/login?to=back'
  293. break
  294. }
  295. default: {
  296. // location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
  297. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  298. break
  299. }
  300. }
  301. },
  302. goOpenOfWx: function (btnText, source) {
  303. switch (btnText) {
  304. case '去开通': {
  305. if(this.type == 'item_9' || this.type == 'item_8') {
  306. // 跳转到大会员
  307. // location.href = '/big/wx/page/buy_commit'
  308. location.href = '/jy_mobile/common/order/create/bigmember'
  309. } else {
  310. // 跳转到超级订阅
  311. // location.href = '/front/vipsubscribe/vipsubscribe_new'
  312. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  313. }
  314. break
  315. }
  316. case '免费体验': {
  317. location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=' + source
  318. break
  319. }
  320. case '前往升级': {
  321. // location.href = '/front/vipsubscribe/upgradePage'
  322. location.href = '/jy_mobile/common/order/create/svip?type=upgrade'
  323. break
  324. }
  325. case '联系客服': {
  326. location.href = '/big/wx/page/customer'
  327. break
  328. }
  329. case '立即解锁': {
  330. location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=ent_portrait_freeuser'
  331. break
  332. }
  333. default: {
  334. // location.href = '/front/vipsubscribe/vipsubscribe_new'
  335. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  336. break
  337. }
  338. }
  339. },
  340. goOpen: function(source) {
  341. // 点击按钮保存tabActiveName值
  342. this.$emit('tabactive', 'save')
  343. const isWeixin = utils.isWeiXinBrowser
  344. if (isWeixin) {
  345. this.goOpenOfWx(this.getTextMap.btnText, source)
  346. } else {
  347. this.goOpenOfApp(this.getTextMap.btnText, source)
  348. }
  349. }
  350. }
  351. }