123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588 |
- <template>
- <view>
- <view class="overlay" v-if="showfx" @click="showwx">
- <image style="height: 100%;width: 100%;" src="/static/img/zz.png"></image>
- </view>
-
-
- <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
- <view class="back-container" @click="handleBack">
- <view class="back-text">返回</view>
- </view>
- <view class="content-container">
- <view class="content-text">{{title}}</view>
- </view>
- </view>
-
- <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="800">
- <swiper-item v-for="(item, index) in swiperList" :key="index">
- <image :src="item.url" class="swiper-item"></image>
- </swiper-item>
- </swiper>
-
- <form class="cu-list menu">
-
- <view class="show1">
-
- <view class="textbg">
- <view class="text1">
- 企业名称
- </view>
- <view class="text2" >
- {{inputForm.des5}}
- </view>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 供需类型
- </view>
- <view class="text2" >
- {{inputForm.des1}}
- </view>
- </view>
-
- <view class="textbg">
- <view class="text1">
- 发布时间
- </view>
- <view class="text2" >
- {{inputForm.updateDate}}
- </view>
- </view>
- </view>
- <view class="titlebg2">
- <view class="titlet1" ></view>
- <view class="titlet2" >供需基本信息</view>
- </view>
-
-
- <view class="textbg">
- <view class="text12">
- {{t1}}
- </view>
- <view class="text22">
- {{inputForm.des2}}
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t2}}
- </view>
- <view class="text22">
- {{inputForm.des3}}
- </view>
- </view>
-
- <view class="textbg">
- <view class="text12">
- {{t3}}
- </view>
- <view class="text221">
- {{inputForm.des4}}
- </view>
- </view>
-
-
-
-
- <view style="height: 40rpx;"></view>
- <view class="padding-xl" v-if="isadmin&&inputForm.des6=='1'">
- <button @click="sharezz" class="cu-btn block bg-blue margin-tb-sm lg">分享此企业账号</button>
- </view>
- </form>
- </view>
- </template>
- <script>
- import loginService from '@/api/auth/loginService.js'
- import { wxShare } from "@/common/wxutils.js";
- export default {
- onShow() {
- //this.$auth.checkLogin()
- },
- data() {
- return {
- title: '产品供需详情',
- isBack: true, // 是否显示返回按钮
- backText: '返回', // 返回按钮的文本
- bgColor: 'bg-blue', // 背景颜色
- autoUpload: false,
- swiperList: [
- // 可以继续添加更多图片
- ],
- inputForm: {
- id: '',
- name: '',
- industry: '',
- des1: '',
- des2: '',
- des3: '',
- des4: '',
- des5: '',
- des6: '',
- des7: '',
- des8: '',
- des9: '',
- updateDate: '',
- },
- t1: '产品名称',
- t2: '产品产能',
- t3: '详细描述',
- text1:'',
- text2:'',
- parkList: [],
- ischeck: false,
- isLogin:"",
- username:"",
- isadmin:false,
- lyIndex: '',
- showLYList: [],
- showfx:false,
- }
- },
- created() {
- },
- mounted() {
-
- },
- onLoad(query) {
- this.isLogin=this.$auth.checkisLogin();
- this.username=this.$auth.getUserInfo();
- if(this.username!=undefined&&this.username!=''&&this.username!=null&&this.isLogin!=null){
- if(this.username.loginName=='admin'){
- this.isadmin=true;
- }
- }
-
- if (query && query.ischeck) {
- this.ischeck = true
- }
- if (query && query.id && !query.ischeck) {
- this.title = "修改企业信息";
- }
- this.getComById(query)
-
-
- },
- methods: {
- getParkList(query) {
- loginService.list({
- current: 1,
- size: 1000000,
- }).then(({
- data
- }) => {
- this.parkList = data.records.map((item) => {
- return {
- label: item.buildingName,
- value: item.id
- }
- })
- this.showLYList = this.parkList.map(item => item.label)
- if (query && query.id) {
- loginService.queryByIdPro(query.id).then(({
- data
- }) => {
- this.inputForm = this.recover(this.inputForm, data)
- this.lyIndex = this.parkList.findIndex(item => item.value == this.inputForm.des1)
- console.log(this.lyIndex, '=====================>lyIndex')
- }).catch((e) => {
-
- })
-
- }
- }).catch(e => {
- console.log(e)
- })
- },
-
- handleBack() {
- // 返回逻辑,比如跳转至上一页
- this.$router.go(-1);
- console.log('返回按钮被点击');
- },
- showwx() {
- this.showfx=false;
- },
-
- getComById(query) {
- loginService.queryByIdPro(query.id).then(({
- data
- }) => {
- //未登录
- // if(this.isLogin==null){
- // console.log('未登录')
- // //不做处理后台已做处理
-
- if(data.des1=='1'){
- data.des1="供"
- }else{
- data.des1="需"
- }
- this.setData(data);
- // }else{
- // this.setData(data);
- // }
-
- }).catch((e) => {
-
- })
- },
-
-
- //账号分享
- sharezz(){
- var that=this;
- setTimeout(function() {
- that.showfx=true;
- console.log("1"+ this.showfx);
- }, 500); // 2000毫秒后执行
-
- loginService.getloginstr(this.inputForm.phone).then(({
- data
- }) => {
- //未登录
- if(data.Id=='0'){
- uni.showModal({
- title: '您无权限分享账号,请联系管!',
- showCancel: true,
- success: (res) => {
-
- }
- });
-
- }else{
-
- this.weixin(data);
-
- // const textArea = document.createElement("textarea");
- // textArea.value = 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/#/pages/index/index?loginid='+data.Id;
- // document.body.appendChild(textArea);
- // textArea.focus();
- // textArea.select();
- // try {
- // document.execCommand('copy');
- // uni.showModal({
- // title: '已将登录链接复制到剪切板,直接打开微信好友粘贴分享!',
- // showCancel: true,
- // success: (res) => {
-
- // }
- // });
- // } catch (err) {
- // console.error('Could not copy text', err);
- // uni.showModal({
- // title: '当前不支持分享功能!',
- // showCancel: true,
- // success: (res) => {
-
- // }
- // });
- // } finally {
- // document.body.removeChild(textArea);
- // }
- }
-
- }).catch((e) => {
-
- })
-
-
-
-
-
-
-
-
-
- },
-
-
- async weixin(data) {
-
- try {
- if ( data) {
- //微信加签
- var obj = {
- appId: data.appid,
- nonceStr: data.nonceStr,
- signature: data.signature,
- timestamp: data.timestamp,
- Id: data.Id,
- }
- //分享数据,这段主要是为了在hash模式下分享出去的链接不被浏览器截取,保证完全把链接分享出去(link的链接可以自己拼,无须与当前页面的后缀参数之类的内容完全一致)
- let shareData = {
- title: '盐都区工业企业产品发布平台',
- desc: '点击直接登录',
- imgUrl: 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/static/img/titlebg.jpg',
- link: 'https://miniapp.huidutech.com.cn/yd_qycpfbH5/#/pages/index/index?loginid='+data.Id + "&t=" + data.timestamp + "&Content=1", // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
-
- };
- //引用
- wxShare(obj, shareData);
-
- } else {
- uni.showModal({
- title: '获取sdk参数失败!',
- showCancel: true,
- success: (res) => {
-
- }
- });
- }
- } catch (err) {
- //
- } finally {
- //
- }
- },
-
-
- setData(data){
- this.inputForm = this.recover(this.inputForm, data)
-
-
- if(this.inputForm=='供'){
- this.t1='产品名称';
- this.t2= '产品产能';
- }else{
- this.t1='需求名称';
- this.t2= '需求数量';
- }
-
-
- let pics=this.inputForm.des6.split(",");
-
- pics.forEach(item => {
- this.swiperList.push({
- 'url': "http://47.97.69.114:8089/yd_qycpfbWeb/"+item,
- })
- })
- },
-
- goToCompany(companyName) {
- //https://www.qcc.com/web/search?key=
-
- window.open("https://www.qcc.com/web/search?key="+companyName);
- //window.location.href = `https://www.qcc.com/company/${encodeURIComponent(companyName)}`;
- },
-
- call1(){
-
- // uni.navigateTo({
- // url: '/pages/index/AudioToWord'
- // })
-
- // uni.navigateTo({
- // url: '/pages/comList/comList'
- // })
-
- //未登录
- if(this.isLogin==null){
- uni.showModal({
- title: '您还未登录,是否跳转登录页面?',
- showCancel: true,
- success: (res) => {
- if (res.confirm) {
-
- uni.reLaunch({
- url: '/pages/login/login'
- })
-
- }
- }
- });
- }else{
- window.location.href = 'tel:'+this.inputForm.phone;
- }
-
- },
-
- call2(){
- //未登录
- if(this.isLogin==null){
- uni.showModal({
- title: '您还未登录,是否跳转登录页面?',
- showCancel: true,
- success: (res) => {
- if (res.confirm) {
-
- uni.reLaunch({
- url: '/pages/login/login'
- })
-
- }
- }
- });
- }else{
- window.location.href = 'tel:'+this.inputForm.bz6;
- }
- },
-
-
- }
- }
- </script>
- <style>
- /* .file-title) {
- font-size: 17px !important;
- } */
- input,textarea{
- color: #8799a3;
- }
-
- .swiper {
- width: 750rpx;
- height: 310rpx;
- }
-
- .swiper-item {
- width: 750rpx;
- height: 310rpx;
- background-color: aliceblue;
- }
- .show1{
- background-color: #2752eb;
- padding-left: 8rpx;
- }
- .textbg{
- display: flex;
- background-color: white;
- padding-top: 29rpx;
- }
- .text1{
- width: 200rpx;
- margin-left: 30rpx;
- color: #333333;
- font-size: 30rpx;
- }
- .text12{
- width: 200rpx;
- margin-left: 30rpx;
- color: #000000;
- font-size: 29rpx;
- }
-
- .text2{
- flex: 1;
- color: #000000;
- font-size: 30rpx;
- padding-bottom: 2rpx;
- }
- .text22{
- flex: 1;
- color: #666666;
- font-size: 29rpx;
- padding-bottom: 2rpx;
- }
-
- .text221{
- flex: 1;
- min-height: 700rpx;
- color: #666666;
- font-size: 29rpx;
- padding-right:15rpx ;
- padding-bottom: 2rpx;
- }
- .text3{
- display: flex;
- color: #000000;
- }
- .phone{
- display: flex;
- color: #1E8AD7;
- padding-left: 5rpx;
- padding-right: 5rpx;
- font-size: 30rpx;
- align-items: center
- }
- .phoneimg{
- margin-left: 10rpx;
- width: 35rpx;
- height: 35rpx;
- }
- .titlebg2{
- display: flex;
- background-color: white;
- padding-left: 22rpx;
- padding-top: 35rpx;
- padding-bottom: 25rpx;
- margin-bottom: 2rpx;
- }
- .titlet1{
- width: 7rpx;
- margin-top: 7rpx;
- margin-bottom: 7rpx;
- background-color: #2752eb;
- margin-right: 8rpx;
- }
- .titlet2{
- font-weight: 800;
- color: #2752eb;
- }
- .overlay{
- position: fixed; /* 固定定位,覆盖整个页面 */
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
- z-index: 1000; /* 确保遮罩在页面内容之上 */
- }
-
-
- .custom-header {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 10px;
- width: 100%;
- }
-
- .is-back {
- position: relative;
- }
-
- .back-container {
- position: absolute;
- left: 10px;
- cursor: pointer;
- }
-
- .back-text {
- color: white; /* 返回按钮文本颜色 */
- }
-
- .content-container {
- flex: 1;
- text-align: center;
- }
-
- .content-text {
- color: white; /* 标题文本颜色 */
- font-weight: bold;
- }
-
- /* 背景颜色 */
- .bg-blue {
- background-color: #4285f4; /* 假设这是一个蓝色背景 */
- }
- </style>
|